Initial commit
This commit is contained in:
commit
4b5f7906d7
33 files changed
+933
No files matched your search
@@ -0,0 +1,27 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module StrikeMe
|
||||
module API
|
||||
class Account
|
||||
class Balances
|
||||
include Enumerable
|
||||
|
||||
attr_reader :account
|
||||
|
||||
def initialize(account, items)
|
||||
@account = account
|
||||
# Map hash to object
|
||||
@items = items.map { |item| Balance.new item }
|
||||
end
|
||||
|
||||
def each(&block)
|
||||
@items.each(&block)
|
||||
end
|
||||
|
||||
def to_a
|
||||
@items.map(&:attributes)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user