Class: AccountCollection
- Inherits:
-
Object
- Object
- AccountCollection
- Includes:
- Enumerable
- Defined in:
- lib/account_service/account_collection.rb
Instance Method Summary collapse
- #add(account) ⇒ Object
- #each ⇒ Object
-
#initialize ⇒ AccountCollection
constructor
A new instance of AccountCollection.
Constructor Details
#initialize ⇒ AccountCollection
Returns a new instance of AccountCollection.
6 7 8 |
# File 'lib/account_service/account_collection.rb', line 6 def initialize @accounts = [] end |
Instance Method Details
#add(account) ⇒ Object
10 11 12 |
# File 'lib/account_service/account_collection.rb', line 10 def add(account) @accounts << account end |
#each ⇒ Object
14 15 16 17 18 |
# File 'lib/account_service/account_collection.rb', line 14 def each @accounts.each do |account| yield account end end |