class MoneyMover::Dwolla::AccountFundingSource

Attributes

created[RW]
name[RW]
status[RW]
type[RW]

Public Class Methods

all(account_id) click to toggle source
# File lib/money_mover/dwolla/models/account_funding_source.rb, line 10
def self.all(account_id)
  client = ApplicationClient.new

  response = client.get fetch_endpoint(account_id)
  response.body[:_embedded][:"funding-sources"].map {|source| new(source) }
end
new(attrs) click to toggle source
Calls superclass method
# File lib/money_mover/dwolla/models/account_funding_source.rb, line 6
def initialize(attrs)
  super id: attrs[:id], name: attrs[:name], status: attrs[:status], type: attrs[:type], created: attrs[:created], _links: attrs[:_links], _embedded: attrs[:_embedded]
end

Private Class Methods

fetch_endpoint(account_id) click to toggle source
# File lib/money_mover/dwolla/models/account_funding_source.rb, line 23
def self.fetch_endpoint(account_id)
  "/accounts/#{account_id}/funding-sources"
end

Public Instance Methods

bank_account?() click to toggle source
# File lib/money_mover/dwolla/models/account_funding_source.rb, line 17
def bank_account?
  type == 'bank'
end