Class: MoneyMover::Dwolla::AccountFundingSource

Inherits:
ApiResource
  • Object
show all
Defined in:
lib/money_mover/dwolla/models/account_funding_source.rb

Instance Attribute Summary collapse

Attributes inherited from ApiResource

#_embedded, #_links, #attrs, #id, #resource_location

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ApiResource

#destroy, fetch, #save

Constructor Details

#initialize(attrs) ⇒ AccountFundingSource



6
7
8
# 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

Instance Attribute Details

#createdObject

Returns the value of attribute created.



4
5
6
# File 'lib/money_mover/dwolla/models/account_funding_source.rb', line 4

def created
  @created
end

#nameObject

Returns the value of attribute name.



4
5
6
# File 'lib/money_mover/dwolla/models/account_funding_source.rb', line 4

def name
  @name
end

#statusObject

Returns the value of attribute status.



4
5
6
# File 'lib/money_mover/dwolla/models/account_funding_source.rb', line 4

def status
  @status
end

#typeObject

Returns the value of attribute type.



4
5
6
# File 'lib/money_mover/dwolla/models/account_funding_source.rb', line 4

def type
  @type
end

Class Method Details

.all(account_id) ⇒ Object



10
11
12
13
14
15
# File 'lib/money_mover/dwolla/models/account_funding_source.rb', line 10

def self.all()
  client = ApplicationClient.new

  response = client.get fetch_endpoint()
  response.body[:_embedded][:"funding-sources"].map {|source| new(source) }
end

Instance Method Details

#bank_account?Boolean



17
18
19
# File 'lib/money_mover/dwolla/models/account_funding_source.rb', line 17

def bank_account?
  type == 'bank'
end