Class: CloudMade::RouteInstruction
- Inherits:
-
Object
- Object
- CloudMade::RouteInstruction
- Defined in:
- lib/cloudmade/routing.rb
Overview
Instructions on route passing
Instance Attribute Summary collapse
-
#azimuth ⇒ Object
readonly
North-based azimuth.
-
#earth_direction ⇒ Object
readonly
Earth direction.
-
#instruction ⇒ Object
readonly
Text instruction.
-
#length ⇒ Object
readonly
Length of the segment in meters.
-
#length_caption ⇒ Object
readonly
Length of the segments in specified units.
-
#position ⇒ Object
readonly
Index of the first point of the segment.
-
#time ⇒ Object
readonly
Estimated time required to travel the segment in seconds.
-
#turn_angle ⇒ Object
readonly
Angle in degress of the turn between two segments.
-
#turn_type ⇒ Object
readonly
Code of the turn type.
Instance Method Summary collapse
-
#initialize(data) ⇒ RouteInstruction
constructor
A new instance of RouteInstruction.
Constructor Details
#initialize(data) ⇒ RouteInstruction
Returns a new instance of RouteInstruction.
131 132 133 134 135 136 137 138 139 140 141 142 143 |
# File 'lib/cloudmade/routing.rb', line 131 def initialize(data) @instruction = data[0] @length = Float(data[1]) @position = Integer(data[2]) @time = Integer(data[3]) @length_caption = data[4] @earth_direction = data[5] @azimuth = Float(data[6]) if data.length == 9 @turn_type = data[7] @turn_angle = data[8] end end |
Instance Attribute Details
#azimuth ⇒ Object (readonly)
North-based azimuth
125 126 127 |
# File 'lib/cloudmade/routing.rb', line 125 def azimuth @azimuth end |
#earth_direction ⇒ Object (readonly)
Earth direction
123 124 125 |
# File 'lib/cloudmade/routing.rb', line 123 def earth_direction @earth_direction end |
#instruction ⇒ Object (readonly)
Text instruction
113 114 115 |
# File 'lib/cloudmade/routing.rb', line 113 def instruction @instruction end |
#length ⇒ Object (readonly)
Length of the segment in meters
115 116 117 |
# File 'lib/cloudmade/routing.rb', line 115 def length @length end |
#length_caption ⇒ Object (readonly)
Length of the segments in specified units
121 122 123 |
# File 'lib/cloudmade/routing.rb', line 121 def @length_caption end |
#position ⇒ Object (readonly)
Index of the first point of the segment
117 118 119 |
# File 'lib/cloudmade/routing.rb', line 117 def position @position end |
#time ⇒ Object (readonly)
Estimated time required to travel the segment in seconds
119 120 121 |
# File 'lib/cloudmade/routing.rb', line 119 def time @time end |
#turn_angle ⇒ Object (readonly)
Angle in degress of the turn between two segments
129 130 131 |
# File 'lib/cloudmade/routing.rb', line 129 def turn_angle @turn_angle end |
#turn_type ⇒ Object (readonly)
Code of the turn type
127 128 129 |
# File 'lib/cloudmade/routing.rb', line 127 def turn_type @turn_type end |