Class: FXRates::Response::Convert

Inherits:
Object
  • Object
show all
Defined in:
lib/fx_rates/response/convert.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Convert

Returns a new instance of Convert.



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/fx_rates/response/convert.rb', line 5

def initialize(response)
  @success = response["success"]
  @from = response["query"]["from"]
  @to = response["query"]["to"]
  @amount = response["query"]["amount"]
  @rate = response["info"]["rate"]
  @date = response["date"]
  @timestamp = response["timestamp"]
  @result = response["result"]
  @raw_response = response
end

Instance Attribute Details

#amountObject (readonly)

Returns the value of attribute amount.



3
4
5
# File 'lib/fx_rates/response/convert.rb', line 3

def amount
  @amount
end

#dateObject (readonly)

Returns the value of attribute date.



3
4
5
# File 'lib/fx_rates/response/convert.rb', line 3

def date
  @date
end

#fromObject (readonly)

Returns the value of attribute from.



3
4
5
# File 'lib/fx_rates/response/convert.rb', line 3

def from
  @from
end

#rateObject (readonly)

Returns the value of attribute rate.



3
4
5
# File 'lib/fx_rates/response/convert.rb', line 3

def rate
  @rate
end

#raw_responseObject (readonly)

Returns the value of attribute raw_response.



3
4
5
# File 'lib/fx_rates/response/convert.rb', line 3

def raw_response
  @raw_response
end

#resultObject (readonly)

Returns the value of attribute result.



3
4
5
# File 'lib/fx_rates/response/convert.rb', line 3

def result
  @result
end

#successObject (readonly)

Returns the value of attribute success.



3
4
5
# File 'lib/fx_rates/response/convert.rb', line 3

def success
  @success
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



3
4
5
# File 'lib/fx_rates/response/convert.rb', line 3

def timestamp
  @timestamp
end

#toObject (readonly)

Returns the value of attribute to.



3
4
5
# File 'lib/fx_rates/response/convert.rb', line 3

def to
  @to
end