Skip to content

Commit 696ba34

Browse files
committed
Passing options as an argument to initializer instead of is_recursive,
1 parent 852f0e3 commit 696ba34

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/ostruct.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ class OpenStruct
8787
#
8888
# data # => #<OpenStruct country="Australia", capital="Canberra">
8989
#
90-
def initialize(hash=nil, is_recursive=false)
90+
def initialize(hash=nil, options={recursive: false})
9191
@table = {}
92-
@recursive = is_recursive
92+
@recursive = options.fetch(:recursive, false)
9393
if hash
9494
hash.each_pair do |k, v|
9595
k = k.to_sym

0 commit comments

Comments
 (0)