Class: HashStruct

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/hash_struct.rb

Overview

Defines HashStruct class, which is simply OpenStruct and has additional accessor mode via square brackets like hashes

Instance Method Summary collapse

Instance Method Details

#[](key) ⇒ Object



6
7
8
# File 'lib/hash_struct.rb', line 6

def [](key)
  self.send key unless key == nil
end