class GoCardlessPro::Resources::CurrencyExchangeRate

Currency exchange rates from our foreign exchange provider.

Attributes

rate[R]
source[R]
target[R]
time[R]

Public Class Methods

new(object, response = nil) click to toggle source

Initialize a currency_exchange_rate resource instance @param object [Hash] an object returned from the API

# File lib/gocardless_pro/resources/currency_exchange_rate.rb, line 24
def initialize(object, response = nil)
  @object = object

  @rate = object['rate']
  @source = object['source']
  @target = object['target']
  @time = object['time']
  @response = response
end

Public Instance Methods

api_response() click to toggle source
# File lib/gocardless_pro/resources/currency_exchange_rate.rb, line 34
def api_response
  ApiResponse.new(@response)
end
to_h() click to toggle source

Provides the currency_exchange_rate resource as a hash of all its readable attributes

# File lib/gocardless_pro/resources/currency_exchange_rate.rb, line 39
def to_h
  @object
end