H
Huw Taylor
If I were to have this:
class Hew
def initialize(string)
@string = string
end
def other_method
end
end
a = Hew.new("Broown Cew")
=> #<Hew:0x40e8238 @string = "Broown Cew">
b = a.to_s
=> "#<Hew:0x40e8238>"
My question is: Is there anyway to get the class (and its info) from b
(i.e what is now a string)?
I see that changing it to a string loses the @string = "Broown Cew" bit.
:/
class Hew
def initialize(string)
@string = string
end
def other_method
end
end
a = Hew.new("Broown Cew")
=> #<Hew:0x40e8238 @string = "Broown Cew">
b = a.to_s
=> "#<Hew:0x40e8238>"
My question is: Is there anyway to get the class (and its info) from b
(i.e what is now a string)?
I see that changing it to a string loses the @string = "Broown Cew" bit.
:/