aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/ostruct.rb8
1 files changed, 1 insertions, 7 deletions
diff --git a/lib/ostruct.rb b/lib/ostruct.rb
index 25ccac8dfa..2edb2edeb4 100644
--- a/lib/ostruct.rb
+++ b/lib/ostruct.rb
@@ -73,12 +73,6 @@
# of these properties compared to using a Hash or a Struct.
#
class OpenStruct
- class << self # :nodoc:
- def allocate
- (x = super).instance_variable_set(:@table, {})
- x
- end
- end
#
# Creates a new OpenStruct object. By default, the resulting OpenStruct
@@ -198,7 +192,7 @@ class OpenStruct
def respond_to_missing?(mid, include_private = false) # :nodoc:
mname = mid.to_s.chomp("=").to_sym
- @table.key?(mname) || super
+ @table&.key?(mname) || super
end
def method_missing(mid, *args) # :nodoc: