Class: Rome2rio::TransitHop

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#durationObject (readonly)

Returns the value of attribute duration.



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

def duration
  @duration
end

#frequencyObject (readonly)

Returns the value of attribute frequency.



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

def frequency
  @frequency
end

#indicativePriceObject (readonly)

Returns the value of attribute indicativePrice.



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

def indicativePrice
  @indicativePrice
end

#linesObject (readonly)

Returns the value of attribute lines.



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

def lines
  @lines
end

#sNameObject (readonly)

Returns the value of attribute sName.



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

def sName
  @sName
end

#sPosObject (readonly)

Returns the value of attribute sPos.



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

def sPos
  @sPos
end

#tNameObject (readonly)

Returns the value of attribute tName.



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

def tName
  @tName
end

#tPosObject (readonly)

Returns the value of attribute tPos.



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

def tPos
  @tPos
end