Class: Wesabe::FinancialInstitution
- Defined in:
- lib/wesabe/financial_institution.rb
Instance Attribute Summary collapse
-
#homepage_url ⇒ Object
The home url of this
FinancialInstitution
. -
#id ⇒ Object
The id of this
FinancialInstitution
, as used in URLs. -
#login_url ⇒ Object
The url users of this
FinancialInstitution
log in to for online banking. -
#name ⇒ Object
The name of this
FinancialInstitution
(“Bank of America”).
Attributes inherited from BaseModel
Class Method Summary collapse
-
.from_xml(xml) ⇒ Wesabe::FinancialInstitution
Returns a
Wesabe::FinancialInstitution
generated from Wesabe’s API XML.
Instance Method Summary collapse
-
#initialize {|financial_institution| ... } ⇒ FinancialInstitution
constructor
Initializes a
Wesabe::FinancialInstitution
and yields itself. - #inspect ⇒ Object
Methods inherited from BaseModel
Methods included from Util
Constructor Details
#initialize {|financial_institution| ... } ⇒ FinancialInstitution
Initializes a Wesabe::FinancialInstitution
and yields itself.
15 16 17 |
# File 'lib/wesabe/financial_institution.rb', line 15 def initialize yield self if block_given? end |
Instance Attribute Details
#homepage_url ⇒ Object
The home url of this FinancialInstitution
.
9 10 11 |
# File 'lib/wesabe/financial_institution.rb', line 9 def homepage_url @homepage_url end |
#id ⇒ Object
The id of this FinancialInstitution
, as used in URLs.
3 4 5 |
# File 'lib/wesabe/financial_institution.rb', line 3 def id @id end |
#login_url ⇒ Object
The url users of this FinancialInstitution
log in to for online banking.
7 8 9 |
# File 'lib/wesabe/financial_institution.rb', line 7 def login_url @login_url end |
#name ⇒ Object
The name of this FinancialInstitution
(“Bank of America”).
5 6 7 |
# File 'lib/wesabe/financial_institution.rb', line 5 def name @name end |
Class Method Details
.from_xml(xml) ⇒ Wesabe::FinancialInstitution
Returns a Wesabe::FinancialInstitution
generated from Wesabe’s API XML.
26 27 28 29 30 31 32 33 |
# File 'lib/wesabe/financial_institution.rb', line 26 def self.from_xml(xml) new do |fi| fi.id = (xml.children_of_type("id") + xml.children_of_type("wesabe-id")).first.inner_text fi.name = xml.at("name").inner_text fi.login_url = xml.at("login-url") && xml.at("login-url").inner_text fi.homepage_url = xml.at("homepage-url") && xml.at("homepage-url").inner_text end end |
Instance Method Details
#inspect ⇒ Object
35 36 37 |
# File 'lib/wesabe/financial_institution.rb', line 35 def inspect inspect_these :id, :name end |