Class: Lightrail::LightrailValue
- Inherits:
-
LightrailObject
- Object
- LightrailObject
- Lightrail::LightrailValue
- Defined in:
- lib/lightrail_stripe/wrappers/lightrail_value.rb
Instance Attribute Summary collapse
-
#asAtDate ⇒ Object
Returns the value of attribute asAtDate.
-
#cardId ⇒ Object
Returns the value of attribute cardId.
-
#cardType ⇒ Object
Returns the value of attribute cardType.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#valueStores ⇒ Object
Returns the value of attribute valueStores.
Class Method Summary collapse
- .retrieve_by_shopper_id(shopper_id, currency) ⇒ Object
- .retrieve_card_details(card_id) ⇒ Object
- .retrieve_code_details(code) ⇒ Object
- .retrieve_contact_account_details(contact_id, currency) ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#asAtDate ⇒ Object
Returns the value of attribute asAtDate.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_value.rb', line 3 def asAtDate @asAtDate end |
#cardId ⇒ Object
Returns the value of attribute cardId.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_value.rb', line 3 def cardId @cardId end |
#cardType ⇒ Object
Returns the value of attribute cardType.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_value.rb', line 3 def cardType @cardType end |
#currency ⇒ Object
Returns the value of attribute currency.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_value.rb', line 3 def currency @currency end |
#valueStores ⇒ Object
Returns the value of attribute valueStores.
3 4 5 |
# File 'lib/lightrail_stripe/wrappers/lightrail_value.rb', line 3 def valueStores @valueStores end |
Class Method Details
.retrieve_by_shopper_id(shopper_id, currency) ⇒ Object
24 25 26 27 28 29 |
# File 'lib/lightrail_stripe/wrappers/lightrail_value.rb', line 24 def self.retrieve_by_shopper_id (shopper_id, currency) Lightrail::Validator.validate_shopper_id!(shopper_id) Lightrail::Validator.validate_currency!(currency) response = Lightrail::Account.get_account_balance_details({shopper_id: shopper_id, currency: currency}) self.new(response) end |
.retrieve_card_details(card_id) ⇒ Object
11 12 13 14 15 |
# File 'lib/lightrail_stripe/wrappers/lightrail_value.rb', line 11 def self.retrieve_card_details (card_id) Lightrail::Validator.validate_card_id!(card_id) response = Lightrail::Card.get_details(card_id) self.new(response) end |
.retrieve_code_details(code) ⇒ Object
5 6 7 8 9 |
# File 'lib/lightrail_stripe/wrappers/lightrail_value.rb', line 5 def self.retrieve_code_details (code) Lightrail::Validator.validate_code! (code) response = Lightrail::Code.get_details(code) self.new(response) end |
.retrieve_contact_account_details(contact_id, currency) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/lightrail_stripe/wrappers/lightrail_value.rb', line 17 def self.retrieve_contact_account_details (contact_id, currency) Lightrail::Validator.validate_contact_id!(contact_id) Lightrail::Validator.validate_currency!(currency) response = Lightrail::Account.get_account_details({contact_id: contact_id, currency: currency}) self.new(response) end |
Instance Method Details
#maximum_value ⇒ Object
32 33 34 35 36 37 38 39 40 |
# File 'lib/lightrail_stripe/wrappers/lightrail_value.rb', line 32 def maximum_value maximum_value = 0 self.valueStores.each do |valueStore| if valueStore['state'] == 'ACTIVE' maximum_value += valueStore['value'] end end maximum_value end |