class ChronopostFuelMultiplier
Constants
- URL
Public Class Methods
new()
click to toggle source
# File lib/chronopost_fuel_multiplier.rb, line 10 def initialize response = PlainHttpClient.get(url, limit: 3, timeout: 10) @page = Nokogiri::HTML response.body end
Public Instance Methods
air_multiplier()
click to toggle source
# File lib/chronopost_fuel_multiplier.rb, line 19 def air_multiplier "%.4f" % (@page.at_css("table.ch-table tbody tr:last-child td:last-child").text.to_f / 100 + 1) end
road_multiplier()
click to toggle source
# File lib/chronopost_fuel_multiplier.rb, line 23 def road_multiplier "%.4f" % (@page.at_css("table.ch-table tbody tr td:last-child").text.to_f / 100 + 1) end
time_period()
click to toggle source
# File lib/chronopost_fuel_multiplier.rb, line 15 def time_period @page.at_css("table.ch-table thead tr th:last-child").text end
url()
click to toggle source
# File lib/chronopost_fuel_multiplier.rb, line 27 def url URL end