class BitstampClient::ExchangeRateResponse

Private Instance Methods

default_exchange_rate() click to toggle source
# File lib/bitstamp_client/responses/exchange_rate_response.rb, line 11
def default_exchange_rate
  json = JSON.parse(body)
  ExchangeRate.new(
    bid: json["bid"],
    ask: json["ask"],
    mid_rate: [json["ask"].to_f, json["bid"].to_f].sum / 2,
    timestamp: json["timestamp"],
  )
end