Method: Collins::AssetType#initialize

Defined in:
lib/collins/asset_type.rb

#initialize(opts = {}) ⇒ AssetType

Returns a new instance of AssetType.



13
14
15
16
17
18
19
20
21
22
# File 'lib/collins/asset_type.rb', line 13

def initialize opts = {}
  hash = symbolize_hash(opts).inject({}) do |result, (k,v)|
    key = k.to_s.downcase.to_sym
    result[key] = v
    result
  end
  @id = hash[:id].to_s.to_i
  @label = hash[:label].to_s
  @name = hash[:name].to_s
end