Class: SolidStruct::NamedStruct
- Inherits:
-
Struct
- Object
- Struct
- SolidStruct::NamedStruct
- Defined in:
- lib/solid_struct.rb
Instance Method Summary collapse
-
#initialize(*args) ⇒ NamedStruct
constructor
Override the initialize to handle hashes of named parameters.
Constructor Details
#initialize(*args) ⇒ NamedStruct
Override the initialize to handle hashes of named parameters
7 8 9 10 11 12 13 |
# File 'lib/solid_struct.rb', line 7 def initialize *args opts = args.last.is_a?(Hash) ? args.pop : Hash.new super *args opts.each_pair do |k, v| self.send "#{k}=", v end end |