Class: GoogleMapDirections::Step
- Inherits:
-
Object
- Object
- GoogleMapDirections::Step
- Defined in:
- lib/google_map_directions/step.rb
Instance Attribute Summary collapse
-
#distance ⇒ Object
readonly
Returns the value of attribute distance.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#end_location ⇒ Object
readonly
Returns the value of attribute end_location.
-
#HTML_instructions ⇒ Object
readonly
Returns the value of attribute HTML_instructions.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#start_location ⇒ Object
readonly
Returns the value of attribute start_location.
Instance Method Summary collapse
- #distance_as_string ⇒ Object
- #distance_in_meters ⇒ Object
- #duration_as_string ⇒ Object
- #duration_in_seconds ⇒ Object
-
#initialize(distance, duration, end_location, start_location, number, html_instructions) ⇒ Step
constructor
A new instance of Step.
Constructor Details
#initialize(distance, duration, end_location, start_location, number, html_instructions) ⇒ Step
Returns a new instance of Step.
5 6 7 8 9 10 11 12 |
# File 'lib/google_map_directions/step.rb', line 5 def initialize(distance, duration, end_location, start_location, number, html_instructions) @distance = distance @duration = duration @end_location = end_location @start_location = start_location @number = number @HTML_instructions = html_instructions end |
Instance Attribute Details
#distance ⇒ Object (readonly)
Returns the value of attribute distance.
3 4 5 |
# File 'lib/google_map_directions/step.rb', line 3 def distance @distance end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
3 4 5 |
# File 'lib/google_map_directions/step.rb', line 3 def duration @duration end |
#end_location ⇒ Object (readonly)
Returns the value of attribute end_location.
3 4 5 |
# File 'lib/google_map_directions/step.rb', line 3 def end_location @end_location end |
#HTML_instructions ⇒ Object (readonly)
Returns the value of attribute HTML_instructions.
3 4 5 |
# File 'lib/google_map_directions/step.rb', line 3 def HTML_instructions @HTML_instructions end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
3 4 5 |
# File 'lib/google_map_directions/step.rb', line 3 def number @number end |
#start_location ⇒ Object (readonly)
Returns the value of attribute start_location.
3 4 5 |
# File 'lib/google_map_directions/step.rb', line 3 def start_location @start_location end |
Instance Method Details
#distance_as_string ⇒ Object
14 15 16 |
# File 'lib/google_map_directions/step.rb', line 14 def distance_as_string return @distance["text"] end |
#distance_in_meters ⇒ Object
17 18 19 |
# File 'lib/google_map_directions/step.rb', line 17 def distance_in_meters return @distance["value"] end |
#duration_as_string ⇒ Object
20 21 22 |
# File 'lib/google_map_directions/step.rb', line 20 def duration_as_string return @duration["text"] end |
#duration_in_seconds ⇒ Object
23 24 25 |
# File 'lib/google_map_directions/step.rb', line 23 def duration_in_seconds return @duration["value"] end |