Class: GoCardlessPro::Resources::CurrencyExchangeRate
- Inherits:
-
Object
- Object
- GoCardlessPro::Resources::CurrencyExchangeRate
- Defined in:
- lib/gocardless_pro/resources/currency_exchange_rate.rb
Overview
Currency exchange rates from our foreign exchange provider.
Instance Attribute Summary collapse
-
#rate ⇒ Object
readonly
Returns the value of attribute rate.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
Instance Method Summary collapse
- #api_response ⇒ Object
-
#initialize(object, response = nil) ⇒ CurrencyExchangeRate
constructor
Initialize a currency_exchange_rate resource instance.
-
#to_h ⇒ Object
Provides the currency_exchange_rate resource as a hash of all its readable attributes.
Constructor Details
#initialize(object, response = nil) ⇒ CurrencyExchangeRate
Initialize a currency_exchange_rate resource instance
19 20 21 22 23 24 25 26 27 |
# File 'lib/gocardless_pro/resources/currency_exchange_rate.rb', line 19 def initialize(object, response = nil) @object = object @rate = object['rate'] @source = object['source'] @target = object['target'] @time = object['time'] @response = response end |
Instance Attribute Details
#rate ⇒ Object (readonly)
Returns the value of attribute rate.
15 16 17 |
# File 'lib/gocardless_pro/resources/currency_exchange_rate.rb', line 15 def rate @rate end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
15 16 17 |
# File 'lib/gocardless_pro/resources/currency_exchange_rate.rb', line 15 def source @source end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
15 16 17 |
# File 'lib/gocardless_pro/resources/currency_exchange_rate.rb', line 15 def target @target end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
15 16 17 |
# File 'lib/gocardless_pro/resources/currency_exchange_rate.rb', line 15 def time @time end |
Instance Method Details
#api_response ⇒ Object
29 30 31 |
# File 'lib/gocardless_pro/resources/currency_exchange_rate.rb', line 29 def api_response ApiResponse.new(@response) end |
#to_h ⇒ Object
Provides the currency_exchange_rate resource as a hash of all its readable attributes
34 35 36 |
# File 'lib/gocardless_pro/resources/currency_exchange_rate.rb', line 34 def to_h @object end |