Module: NestedStruct::Interface

Defined in:
lib/nested_struct/interface.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



3
4
5
# File 'lib/nested_struct/interface.rb', line 3

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#initialize(attributes = {}) ⇒ Object



27
28
29
# File 'lib/nested_struct/interface.rb', line 27

def initialize(attributes = {})
  assign_field_values(attributes)
end

#to_hashObject



31
32
33
# File 'lib/nested_struct/interface.rb', line 31

def to_hash
  Hash[map_fields]
end