Class: EODData::Client::BushelPrice

Inherits:
Object
  • Object
show all
Defined in:
lib/eod_data/client.rb

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(price) ⇒ BushelPrice

Returns a new instance of BushelPrice.



135
136
137
# File 'lib/eod_data/client.rb', line 135

def initialize(price)
  @price = price
end

Instance Method Details

#callObject



139
140
141
142
143
144
# File 'lib/eod_data/client.rb', line 139

def call
  components = @price.strip.split('.')
  fraction_amount = components[1] || 0

  "#{components[0]}.#{fraction_amount}".to_f / 100
end