Class: Google::Maps::DistanceMatrix
- Inherits:
-
Object
- Object
- Google::Maps::DistanceMatrix
- Defined in:
- lib/google_maps/distance_matrix.rb
Instance Attribute Summary collapse
-
#from ⇒ Object
Returns the value of attribute from.
-
#options ⇒ Object
Returns the value of attribute options.
-
#to ⇒ Object
Returns the value of attribute to.
Instance Method Summary collapse
- #distance ⇒ Object
- #duration ⇒ Object
-
#initialize(from, to, options = {}) ⇒ DistanceMatrix
constructor
A new instance of DistanceMatrix.
Constructor Details
#initialize(from, to, options = {}) ⇒ DistanceMatrix
Returns a new instance of DistanceMatrix.
10 11 12 13 14 15 |
# File 'lib/google_maps/distance_matrix.rb', line 10 def initialize(from, to, = {}) = { language: } unless .is_a? Hash @from = from @to = to @options = { language: :en }.merge() end |
Instance Attribute Details
#from ⇒ Object
Returns the value of attribute from.
8 9 10 |
# File 'lib/google_maps/distance_matrix.rb', line 8 def from @from end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/google_maps/distance_matrix.rb', line 8 def @options end |
#to ⇒ Object
Returns the value of attribute to.
8 9 10 |
# File 'lib/google_maps/distance_matrix.rb', line 8 def to @to end |
Instance Method Details
#distance ⇒ Object
17 18 19 |
# File 'lib/google_maps/distance_matrix.rb', line 17 def distance element.distance.value end |
#duration ⇒ Object
21 22 23 |
# File 'lib/google_maps/distance_matrix.rb', line 21 def duration element.duration.value end |