Class: Killbill::Plugin::ActiveMerchant::RSpec::FakeJavaUserAccountApi
- Defined in:
- lib/killbill/helpers/active_merchant/killbill_spec_helper.rb
Instance Attribute Summary collapse
-
#accounts ⇒ Object
Returns the value of attribute accounts.
Instance Method Summary collapse
- #get_account_by_id(id, context) ⇒ Object
- #get_account_by_key(external_key, context) ⇒ Object
-
#initialize ⇒ FakeJavaUserAccountApi
constructor
A new instance of FakeJavaUserAccountApi.
Constructor Details
#initialize ⇒ FakeJavaUserAccountApi
Returns a new instance of FakeJavaUserAccountApi.
123 124 125 |
# File 'lib/killbill/helpers/active_merchant/killbill_spec_helper.rb', line 123 def initialize @accounts = [] end |
Instance Attribute Details
#accounts ⇒ Object
Returns the value of attribute accounts.
121 122 123 |
# File 'lib/killbill/helpers/active_merchant/killbill_spec_helper.rb', line 121 def accounts @accounts end |
Instance Method Details
#get_account_by_id(id, context) ⇒ Object
127 128 129 |
# File 'lib/killbill/helpers/active_merchant/killbill_spec_helper.rb', line 127 def get_account_by_id(id, context) @accounts.find { |account| account.id == id.to_s } end |
#get_account_by_key(external_key, context) ⇒ Object
131 132 133 |
# File 'lib/killbill/helpers/active_merchant/killbill_spec_helper.rb', line 131 def get_account_by_key(external_key, context) @accounts.find { |account| account.external_key == external_key.to_s } end |