T
Terry Smith
Ok - I know how to get the fields of an Openstruct object like so
class OpenStruct
def fields
@table.keys.map{|k| k.to_s}
end
end
a = OpenStruc.new()
a.foo = 1
a.bar = 2
a.fields -> ["foo", "bar"]
Great - ok how do I WORK with these once I have them?
call doesn't work [] doesn't work...
I KNOW this is one of those obvious ones that I am somehow
overlooking...
Please tell me the simple straightforward thing I am missing here...
class OpenStruct
def fields
@table.keys.map{|k| k.to_s}
end
end
a = OpenStruc.new()
a.foo = 1
a.bar = 2
a.fields -> ["foo", "bar"]
Great - ok how do I WORK with these once I have them?
call doesn't work [] doesn't work...
I KNOW this is one of those obvious ones that I am somehow
overlooking...
Please tell me the simple straightforward thing I am missing here...