Class: Periplus::Route

Inherits:
BingResponse show all
Defined in:
lib/periplus/route.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BingResponse

#error, #initialize

Constructor Details

This class inherits a constructor from Periplus::BingResponse

Instance Attribute Details

#distanceObject

Returns the value of attribute distance.



6
7
8
# File 'lib/periplus/route.rb', line 6

def distance
  @distance
end

#distance_unitObject

Returns the value of attribute distance_unit.



7
8
9
# File 'lib/periplus/route.rb', line 7

def distance_unit
  @distance_unit
end

#durationObject

Returns the value of attribute duration.



8
9
10
# File 'lib/periplus/route.rb', line 8

def duration
  @duration
end

#responseObject

Returns the value of attribute response.



5
6
7
# File 'lib/periplus/route.rb', line 5

def response
  @response
end

#routeObject

Returns the value of attribute route.



9
10
11
# File 'lib/periplus/route.rb', line 9

def route
  @route
end

Instance Method Details

#parseObject



11
12
13
14
15
16
17
18
# File 'lib/periplus/route.rb', line 11

def parse
  super()

  @distance = @primary_resource["travelDistance"]
  @distance_unit = @primary_resource["distanceUnit"].downcase.to_sym
  @duration = @primary_resource["travelDuration"]
  @route = @primary_resource
end