Class: Rome2rio::TransitHop
- Inherits:
-
Object
- Object
- Rome2rio::TransitHop
- Defined in:
- lib/rome2rio/response/transit_hop.rb
Instance Attribute Summary collapse
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#frequency ⇒ Object
readonly
Returns the value of attribute frequency.
-
#indicativePrice ⇒ Object
readonly
Returns the value of attribute indicativePrice.
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#sName ⇒ Object
readonly
Returns the value of attribute sName.
-
#sPos ⇒ Object
readonly
Returns the value of attribute sPos.
-
#tName ⇒ Object
readonly
Returns the value of attribute tName.
-
#tPos ⇒ Object
readonly
Returns the value of attribute tPos.
Instance Method Summary collapse
-
#initialize(json) ⇒ TransitHop
constructor
A new instance of TransitHop.
Constructor Details
#initialize(json) ⇒ TransitHop
Returns a new instance of TransitHop.
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/rome2rio/response/transit_hop.rb', line 4 def initialize(json) @sName = json["sName"] @sPos = Position.parse(json["sPos"]) @tName = json["tName"] @tPos = Position.parse(json["tPos"]) @frequency = json["frequency"] @duration = json["duration"] @indicativePrice = IndicativePrice.new(json["indicativePrice"]) @lines = [] json["lines"].each { |line| @lines << TransitLine.new(line) } end |
Instance Attribute Details
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
3 4 5 |
# File 'lib/rome2rio/response/transit_hop.rb', line 3 def duration @duration end |
#frequency ⇒ Object (readonly)
Returns the value of attribute frequency.
3 4 5 |
# File 'lib/rome2rio/response/transit_hop.rb', line 3 def frequency @frequency end |
#indicativePrice ⇒ Object (readonly)
Returns the value of attribute indicativePrice.
3 4 5 |
# File 'lib/rome2rio/response/transit_hop.rb', line 3 def indicativePrice @indicativePrice end |
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
3 4 5 |
# File 'lib/rome2rio/response/transit_hop.rb', line 3 def lines @lines end |
#sName ⇒ Object (readonly)
Returns the value of attribute sName.
3 4 5 |
# File 'lib/rome2rio/response/transit_hop.rb', line 3 def sName @sName end |
#sPos ⇒ Object (readonly)
Returns the value of attribute sPos.
3 4 5 |
# File 'lib/rome2rio/response/transit_hop.rb', line 3 def sPos @sPos end |
#tName ⇒ Object (readonly)
Returns the value of attribute tName.
3 4 5 |
# File 'lib/rome2rio/response/transit_hop.rb', line 3 def tName @tName end |
#tPos ⇒ Object (readonly)
Returns the value of attribute tPos.
3 4 5 |
# File 'lib/rome2rio/response/transit_hop.rb', line 3 def tPos @tPos end |