Module: Safe::ClassMethods

Defined in:
lib/safestruct.rb

Instance Method Summary collapse

Instance Method Details

#struct(class_name, **attributes) ⇒ Object

add more convenience “constructor” methods

e.g. struct 'Voter', { weight: 0, voted: false, vote: 0, delegate: '0x0000'}
 or  struct 'Voter', weight: 0, voted: false, vote: 0, delegate: '0x0000'


102
103
104
# File 'lib/safestruct.rb', line 102

def struct( class_name, **attributes )
  SafeStruct.new( class_name, attributes )
end