aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ostruct.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ostruct.rb')
-rw-r--r--lib/ostruct.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index e5b69608ad..17efcdc8d3 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -176,6 +176,11 @@ class OpenStruct
end
protected :new_ostruct_member
+ def freeze
+ @table.each_key {|key| new_ostruct_member(key)}
+ super
+ end
+
def respond_to_missing?(mid, include_private = false)
mname = mid.to_s.chomp("=").to_sym
@table.key?(mname) || super