Class: ECMBlockchain::TokenModel
- Inherits:
-
Object
- Object
- ECMBlockchain::TokenModel
- Includes:
- ActiveModel::Validations
- Defined in:
- lib/ecm-blockchain-api/models/token_model.rb
Instance Attribute Summary collapse
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#owner ⇒ Object
Returns the value of attribute owner.
-
#quantity ⇒ Object
Returns the value of attribute quantity.
-
#transferee ⇒ Object
Returns the value of attribute transferee.
Instance Method Summary collapse
-
#initialize(data = {}) ⇒ TokenModel
constructor
A new instance of TokenModel.
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
#kind ⇒ Object
Returns the value of attribute kind.
7 8 9 |
# File 'lib/ecm-blockchain-api/models/token_model.rb', line 7 def kind @kind end |
#owner ⇒ Object
Returns the value of attribute owner.
7 8 9 |
# File 'lib/ecm-blockchain-api/models/token_model.rb', line 7 def owner @owner end |
#quantity ⇒ Object
Returns the value of attribute quantity.
7 8 9 |
# File 'lib/ecm-blockchain-api/models/token_model.rb', line 7 def quantity @quantity end |
#transferee ⇒ Object
Returns the value of attribute transferee.
7 8 9 |
# File 'lib/ecm-blockchain-api/models/token_model.rb', line 7 def transferee @transferee end |