Sha256: fef9e764bb9fe4962f70d494209523175fcdb6528c36d4fbb33f00826251e0ba

Contents?: true

Size: 610 Bytes

Versions: 12

Compression:

Stored size: 610 Bytes

Contents

module Ratis

  class Itinerary

    attr_accessor :co2_auto, :co2_transit, :final_walk_dir, :legs, :reduced_fare, :regular_fare, :transit_time, :trace_info

    def initialize(response)
      @co2_auto       = response[:co2auto].to_f
      @co2_transit    = response[:co2transit].to_f
      @final_walk_dir = response[:finalwalkdir]
      @reduced_fare   = response[:reducedfare].to_f
      @regular_fare   = response[:regularfare].to_f
      @transit_time   = response[:transittime].to_i
      @trace_info     = response[:traceinfo]
      @legs           = response.to_array :legs, :leg
    end

  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
ratis-3.6.2 lib/ratis/itinerary.rb
ratis-3.6.1 lib/ratis/itinerary.rb
ratis-3.6.0 lib/ratis/itinerary.rb
ratis-3.5.0 lib/ratis/itinerary.rb
ratis-3.4.3 lib/ratis/itinerary.rb
ratis-3.4.2 lib/ratis/itinerary.rb
ratis-3.4.1 lib/ratis/itinerary.rb
ratis-3.4.0 lib/ratis/itinerary.rb
ratis-3.3.7 lib/ratis/itinerary.rb
ratis-3.3.6 lib/ratis/itinerary.rb
ratis-3.3.5 lib/ratis/itinerary.rb
ratis-3.3.4 lib/ratis/itinerary.rb