Class: Rome2rio::TransitLeg
- Inherits:
-
Object
- Object
- Rome2rio::TransitLeg
- Defined in:
- lib/rome2rio/response/transit_leg.rb
Instance Attribute Summary collapse
-
#hops ⇒ Object
readonly
Returns the value of attribute hops.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(json) ⇒ TransitLeg
constructor
A new instance of TransitLeg.
Constructor Details
#initialize(json) ⇒ TransitLeg
Returns a new instance of TransitLeg.
4 5 6 7 8 |
# File 'lib/rome2rio/response/transit_leg.rb', line 4 def initialize(json) @url = json["url"] @hops = [] json["hops"].each { |hop| @hops << TransitHop.new(hop) } end |
Instance Attribute Details
#hops ⇒ Object (readonly)
Returns the value of attribute hops.
3 4 5 |
# File 'lib/rome2rio/response/transit_leg.rb', line 3 def hops @hops end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/rome2rio/response/transit_leg.rb', line 3 def url @url end |