Class: ECMBlockchain::TokensCollection

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/ecm-blockchain-api/models/token_collection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#tokensObject

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