Class: FioAPI::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/base.rb

Instance Method Summary collapse

Constructor Details

#initialize(*hash) ⇒ Base

Allow ruby object to be initialized with params

Parameters:

hash

Hash where key is attribute and value is new attribute value

Returns:

New object with prefilled attributes


12
13
14
# File 'lib/base.rb', line 12

def initialize(*hash)
  hash.first.each { |k, v| send("#{k}=", v) } if hash.length == 1 && hash.first.is_a?(Hash)
end