Class: Rome2rio::TransitItinerary

Inherits:
Object
  • Object
show all
Defined in:
lib/rome2rio/response/transit_itinerary.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ TransitItinerary

Returns a new instance of TransitItinerary.



4
5
6
7
# File 'lib/rome2rio/response/transit_itinerary.rb', line 4

def initialize(json)
  @legs = []
  json["legs"].each { |leg| @legs << TransitLeg.new(leg) }
end

Instance Attribute Details

#legsObject (readonly)

Returns the value of attribute legs.



3
4
5
# File 'lib/rome2rio/response/transit_itinerary.rb', line 3

def legs
  @legs
end