We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 852f0e3 commit 696ba34Copy full SHA for 696ba34
lib/ostruct.rb
@@ -87,9 +87,9 @@ class OpenStruct
87
#
88
# data # => #<OpenStruct country="Australia", capital="Canberra">
89
90
- def initialize(hash=nil, is_recursive=false)
+ def initialize(hash=nil, options={recursive: false})
91
@table = {}
92
- @recursive = is_recursive
+ @recursive = options.fetch(:recursive, false)
93
if hash
94
hash.each_pair do |k, v|
95
k = k.to_sym
0 commit comments