Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #2314

Re: Autoconvert object from one class1 to other class2 in class1 def

From Luk Mus <support@fit4u.su>
Newsgroups comp.lang.ruby
Subject Re: Autoconvert object from one class1 to other class2 in class1 def
Date 2011-04-05 04:15 -0500
Organization Service de news de lacave.net
Message-ID <48a449220f19a90143933ae377a0bbb3@ruby-forum.com> (permalink)
References <5095fcbac456c1c2b31e5c05fbea960d@ruby-forum.com> <3962d67dedc7aa2c534540d17939bf1a@ruby-forum.com>

Show all headers | View raw


Brian Candler wrote in post #990955:
>> or how get name of variable in class method?
>
> That's not possible either. The same object could be pointed to by many
> variables (local and/or global and/or instance), or by none. For
> example, maybe the only reference to the object is as a value in a Hash.

Thanks!

But i can get object_id:

class String
  def get_id
    puts self.__id__
    puts self.object_id
  end
end

Is it realy to get name by ID?

-- 
Posted via http://www.ruby-forum.com/.

Back to comp.lang.ruby | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Autoconvert object from one class1 to other class2 in class1 def Luk Mus <support@fit4u.su> - 2011-04-05 03:02 -0500
  Re: Autoconvert object from one class1 to other class2 in class1 def Luk Mus <support@fit4u.su> - 2011-04-05 03:19 -0500
  Re: Autoconvert object from one class1 to other class2 in class1 def Brian Candler <b.candler@pobox.com> - 2011-04-05 03:46 -0500
    Re: Autoconvert object from one class1 to other class2 in class1 def Luk Mus <support@fit4u.su> - 2011-04-05 04:15 -0500
      Re: Autoconvert object from one class1 to other class2 in class1 def Brian Candler <b.candler@pobox.com> - 2011-04-05 07:41 -0500
      Re: Autoconvert object from one class1 to other class2 in class1 def Adam Prescott <adam@aprescott.com> - 2011-04-05 07:50 -0500
      Re: Autoconvert object from one class1 to other class2 in class1 def Robert Klemme <shortcutter@googlemail.com> - 2011-04-05 07:56 -0500

csiph-web