Class: FuelSurcharge::Chronopost

Inherits:
Object
  • Object
show all
Defined in:
lib/fuel_surcharge/chronopost.rb

Instance Method Summary collapse

Instance Method Details

#air_multiplierObject



15
16
17
# File 'lib/fuel_surcharge/chronopost.rb', line 15

def air_multiplier
  air_percentage&.to_multiplier
end

#air_percentageObject



23
24
25
26
27
28
# File 'lib/fuel_surcharge/chronopost.rb', line 23

def air_percentage
  @air_percentage ||= begin
    table_row = HTMLScanner.new(air_content).all("td")
    table_row[1]
  end
end

#road_multiplierObject



19
20
21
# File 'lib/fuel_surcharge/chronopost.rb', line 19

def road_multiplier
  road_percentage&.to_multiplier
end

#road_percentageObject



30
31
32
33
34
35
# File 'lib/fuel_surcharge/chronopost.rb', line 30

def road_percentage
  @road_percentage ||= begin
   table_row = HTMLScanner.new(road_content).all("td")
   table_row[1]
 end
end

#time_periodObject



11
12
13
# File 'lib/fuel_surcharge/chronopost.rb', line 11

def time_period
  periods[1]
end

#urlObject



37
38
39
# File 'lib/fuel_surcharge/chronopost.rb', line 37

def url
  "https://www.chronopost.fr/fr/surcharge-carburant"
end