Class: Coinbase::Asset

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

Overview

A representation of an Asset.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(network_id:, asset_id:, display_name:, address_id: nil) ⇒ Asset

Returns a new Asset object.

Parameters:

  • network_id (Symbol)

    The ID of the Network to which the Asset belongs

  • asset_id (Symbol)

    The Asset ID

  • display_name (String)

    The Asset’s display name

  • address_id (String) (defaults to: nil)

    (Optional) The Asset’s address ID, if one exists



13
14
15
16
17
18
# File 'lib/coinbase/asset.rb', line 13

def initialize(network_id:, asset_id:, display_name:, address_id: nil)
  @network_id = network_id
  @asset_id = asset_id
  @display_name = display_name
  @address_id = address_id
end

Instance Attribute Details

#address_idObject (readonly)

Returns the value of attribute address_id.



6
7
8
# File 'lib/coinbase/asset.rb', line 6

def address_id
  @address_id
end

#asset_idObject (readonly)

Returns the value of attribute asset_id.



6
7
8
# File 'lib/coinbase/asset.rb', line 6

def asset_id
  @asset_id
end

#display_nameObject (readonly)

Returns the value of attribute display_name.



6
7
8
# File 'lib/coinbase/asset.rb', line 6

def display_name
  @display_name
end

#network_idObject (readonly)

Returns the value of attribute network_id.



6
7
8
# File 'lib/coinbase/asset.rb', line 6

def network_id
  @network_id
end