Class: Awestruct::AStruct

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

Direct Known Subclasses

Context, Page, Site

Constant Summary

Constants included from AStructMixin

Awestruct::AStructMixin::UNTRACKED_KEYS

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.



13
14
15
# File 'lib/awestruct/astruct.rb', line 13

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

#hashObject



24
25
26
# File 'lib/awestruct/astruct.rb', line 24

def hash()
  self.output_path.hash
end

#inspectObject



20
21
22
# File 'lib/awestruct/astruct.rb', line 20

def inspect
  "AStruct{...}"
end