class SolidStruct::NamedStruct

Public Class Methods

new(*args) click to toggle source

Override the initialize to handle hashes of named parameters

Calls superclass method
# 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