Ohm オブジェクトのフィールドを動的に設定するにはどうすればよいですか?
class OhmObj < Ohm::Model
attribute :foo
attribute :bar
attribute :baz
def add att, val
self[att] = val
end
end
class OtherObj
def initialize
@ohm_obj = OhmObj.create
end
def set att, val
@ohm_obj[att] = val #doesn't work
@ohm_obj.add(att, val) #doesn't work
end
end