Initialize doesn't appear to get called.
class Object
def initialize
@foo = 'bar'
end
attr_reader :foo
end
a = Object.new # => #<Object:0x54c964 @foo="bar">
a.foo # => "bar"
'string'.foo # => nil
//.foo # => nil
I want to have //.foo and 'string.foo give me "bar" as they should. How
can I do that?
--
Posted via http://www.ruby-forum.com/.