Class: ECMBlockchain::TokenModel

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/ecm-blockchain-api/models/token_model.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = {}) ⇒ TokenModel

Returns a new instance of TokenModel.



11
12
13
14
15
16
17
# File 'lib/ecm-blockchain-api/models/token_model.rb', line 11

def initialize(data={})
  @kind = data.fetch(:kind)
  @quantity = data.fetch(:quantity)
  @owner = data.fetch(:owner, nil)
  @transferee = data.fetch(:transferee, nil)
  raise error unless valid?
end

Instance Attribute Details

#kindObject

Returns the value of attribute kind.



7
8
9
# File 'lib/ecm-blockchain-api/models/token_model.rb', line 7

def kind
  @kind
end

#ownerObject

Returns the value of attribute owner.



7
8
9
# File 'lib/ecm-blockchain-api/models/token_model.rb', line 7

def owner
  @owner
end

#quantityObject

Returns the value of attribute quantity.



7
8
9
# File 'lib/ecm-blockchain-api/models/token_model.rb', line 7

def quantity
  @quantity
end

#transfereeObject

Returns the value of attribute transferee.



7
8
9
# File 'lib/ecm-blockchain-api/models/token_model.rb', line 7

def transferee
  @transferee
end