Class: IndeStruct::Parser::OpenStructAnyCase

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/inde_struct/parser/open_struct_any_case.rb

Instance Method Summary collapse

Constructor Details

#initialize(hash = nil) ⇒ OpenStructAnyCase

Returns a new instance of OpenStructAnyCase.


8
9
10
11
12
13
14
15
16
17
# File 'lib/inde_struct/parser/open_struct_any_case.rb', line 8

def initialize(hash=nil)
  @table = IndeStruct::Parser::HashAnyCase.new
  if hash
    hash.each_pair do |k, v|
      k = k.to_sym
      @table[k] = v
      new_ostruct_member(k)
    end
  end
end