class OpenStruct
def new_ostruct_member!(name) # :nodoc:
define_singleton_method for both the getter method and the setter method.
OpenStruct. It does this by using the metaprogramming function
Used internally to defined properties on the
def new_ostruct_member!(name) # :nodoc: name = name.to_sym unless singleton_class.method_defined?(name) define_singleton_method(name) { @table[name] } define_singleton_method("#{name}=") {|x| modifiable?[name] = x} end name end