Class: CurrencyConversion::ExchangeRates

Inherits:
Object
  • Object
show all
Defined in:
lib/currency-conversion/objects/exchange_rates.rb

Overview

ExchangeRates

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ExchangeRates

Returns a new instance of ExchangeRates.



12
13
14
15
# File 'lib/currency-conversion/objects/exchange_rates.rb', line 12

def initialize(response)
  @response = response
  @body = response.body
end

Instance Attribute Details

#bodyHash (readonly)

Returns The response body.

Returns:

  • (Hash)

    The response body



7
8
9
# File 'lib/currency-conversion/objects/exchange_rates.rb', line 7

def body
  @body
end

#responseFaraday::Response (readonly)

Returns The Faraday Response.

Returns:

  • (Faraday::Response)

    The Faraday Response



10
11
12
# File 'lib/currency-conversion/objects/exchange_rates.rb', line 10

def response
  @response
end

Instance Method Details

#dataObject



17
18
19
# File 'lib/currency-conversion/objects/exchange_rates.rb', line 17

def data
  body['data']
end

#last_updated_atObject



25
26
27
# File 'lib/currency-conversion/objects/exchange_rates.rb', line 25

def last_updated_at
  meta['last_updated_at']
end

#metaObject



21
22
23
# File 'lib/currency-conversion/objects/exchange_rates.rb', line 21

def meta
  body['meta']
end