K
Kero
Sum = Struct.newbla, :"sum(value)")
Not sure this is an error in ruby (1.8.5) or a misunderstanding from me (about Struct).
And yes, I know how to get/set the value anyway:
Bye,
Kero.
sum = Sum.new(2, 5)
=> # said:sum.send"sum(value)")
NameError: invalid attribute name `sum(value)'NoMethodError: undefined method `sum(value)' for # said:class X
attr_accessor :"sum(value)"
end
class Sum
define_method"sum(value)") { "summum!" }
end
=> "summum!"=> # said:sum.send"sum(value)")
Not sure this is an error in ruby (1.8.5) or a misunderstanding from me (about Struct).
And yes, I know how to get/set the value anyway:
=> 42sum[:"sum(value)"] => 5
sum["sum(value)"] = 42
Bye,
Kero.