Class: ECMBlockchain::TokensCollection
- Inherits:
-
Object
- Object
- ECMBlockchain::TokensCollection
- Includes:
- Enumerable
- Defined in:
- lib/ecm-blockchain-api/models/token_collection.rb
Instance Attribute Summary collapse
-
#tokens ⇒ Object
Returns the value of attribute tokens.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(tokens = []) ⇒ TokensCollection
constructor
A new instance of TokensCollection.
Constructor Details
#initialize(tokens = []) ⇒ TokensCollection
Returns a new instance of TokensCollection.
7 8 9 10 11 |
# File 'lib/ecm-blockchain-api/models/token_collection.rb', line 7 def initialize(tokens=[]) self.tokens = tokens.map do |token| ECMBlockchain::TokenModel.new(token) end end |
Instance Attribute Details
#tokens ⇒ Object
Returns the value of attribute tokens.
5 6 7 |
# File 'lib/ecm-blockchain-api/models/token_collection.rb', line 5 def tokens @tokens end |
Instance Method Details
#each(&block) ⇒ Object
13 14 15 |
# File 'lib/ecm-blockchain-api/models/token_collection.rb', line 13 def each(&block) self.tokens.each(&block) end |