summaryrefslogtreecommitdiff
path: root/lib/ostruct.rb
diff options
context:
space:
mode:
-rw-r--r--lib/ostruct.rb10
1 files changed, 8 insertions, 2 deletions
@@ -221,8 +221,14 @@ class OpenStruct
#
def new_ostruct_member!(name) # :nodoc:
unless @table.key?(name) || is_method_protected!(name)
- define_singleton_method!(name) { @table[name] }
- define_singleton_method!("#{name}=") {|x| @table[name] = x}
end
end
private :new_ostruct_member!