Class: Asset

Inherits:
Object
  • Object
show all
Defined in:
lib/api/utils/asset.rb

Overview

This class is used to create an Asset object

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, type) ⇒ Asset

Returns a new instance of Asset.



7
8
9
10
11
12
13
14
15
16
# File 'lib/api/utils/asset.rb', line 7

def initialize(data, type)
  @data = data
  @type = type
  @name = @data['name']
  @id = @data['id']
  @asset_name = @data['assetName']

  fetch_localized_names
  remove_instance_variable(:@data)
end

Instance Attribute Details

#asset_nameObject (readonly)

Returns the value of attribute asset_name.



5
6
7
# File 'lib/api/utils/asset.rb', line 5

def asset_name
  @asset_name
end

#idObject (readonly)

Returns the value of attribute id.



5
6
7
# File 'lib/api/utils/asset.rb', line 5

def id
  @id
end

#localized_namesObject (readonly)

Returns the value of attribute localized_names.



5
6
7
# File 'lib/api/utils/asset.rb', line 5

def localized_names
  @localized_names
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/api/utils/asset.rb', line 5

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/api/utils/asset.rb', line 5

def type
  @type
end