Class: Awestruct::AStruct

Inherits:
Hash
  • Object
show all
Includes:
AStructMixin
Defined in:
lib/awestruct/astruct.rb

Direct Known Subclasses

Context, Site

Instance Method Summary collapse

Methods included from AStructMixin

#[], #cascade_for_nils!, extended, #key?, #method_missing, #transform_entry

Constructor Details

#initialize(hash = nil) ⇒ AStruct

Returns a new instance of AStruct.



9
10
11
# File 'lib/awestruct/astruct.rb', line 9

def initialize(hash=nil)
  hash.each{|k,v| self[k]=v } if hash
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Awestruct::AStructMixin

Instance Method Details

#inspectObject



16
17
18
# File 'lib/awestruct/astruct.rb', line 16

def inspect
  "AStruct{...}"
end