Module: Syrup
- Extended by:
- Syrup
- Included in:
- Syrup
- Defined in:
- lib/syrup.rb,
lib/syrup/account.rb,
lib/syrup/version.rb,
lib/syrup/transaction.rb,
lib/syrup/institutions/uccu.rb,
lib/syrup/institutions/zions_bank.rb,
lib/syrup/information_missing_error.rb,
lib/syrup/institutions/institution_base.rb
Defined Under Namespace
Modules: Institutions Classes: Account, InformationMissingError, Transaction
Constant Summary collapse
- VERSION =
"0.0.13"
Instance Method Summary collapse
-
#institutions ⇒ Object
Returns an array of institutions.
-
#setup_institution(institution_id) ⇒ Object
Returns a new institution object with the specified
institution_id
.
Instance Method Details
#institutions ⇒ Object
Returns an array of institutions.
Syrup.institutions.each do |institution|
puts "name: #{institution.name}, id: #{institution.id}"
end
20 21 22 |
# File 'lib/syrup.rb', line 20 def institutions Institutions::InstitutionBase.subclasses end |
#setup_institution(institution_id) ⇒ Object
Returns a new institution object with the specified institution_id
. If you pass in a block, you can use it to setup the username, password, and secret_questions.
Syrup.setup_institution('zions_bank') do |config|
config.username = "my_user"
config.password = "my_password"
config.secret_questions = {
'How long is your beard?' => '6in'
}
end
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/syrup.rb', line 34 def setup_institution(institution_id) institution = institutions.find { |i| i.id == institution_id } if institution i = institution.new if block_given? i.setup { |config| yield config } else i end end end |