Class: GoogleDistanceMatrix::UrlBuilder
- Inherits:
-
Object
- Object
- GoogleDistanceMatrix::UrlBuilder
- Defined in:
- lib/google_distance_matrix/url_builder.rb
Constant Summary collapse
- BASE_URL =
"maps.googleapis.com/maps/api/distancematrix/json"
- DELIMITER =
CGI.escape("|")
- MAX_URL_SIZE =
2048
Instance Attribute Summary collapse
-
#matrix ⇒ Object
readonly
Returns the value of attribute matrix.
Instance Method Summary collapse
-
#initialize(matrix) ⇒ UrlBuilder
constructor
A new instance of UrlBuilder.
- #url ⇒ Object
Constructor Details
#initialize(matrix) ⇒ UrlBuilder
Returns a new instance of UrlBuilder.
10 11 12 13 14 |
# File 'lib/google_distance_matrix/url_builder.rb', line 10 def initialize(matrix) @matrix = matrix fail InvalidMatrix.new matrix if matrix.invalid? end |
Instance Attribute Details
#matrix ⇒ Object (readonly)
Returns the value of attribute matrix.
7 8 9 |
# File 'lib/google_distance_matrix/url_builder.rb', line 7 def matrix @matrix end |
Instance Method Details
#url ⇒ Object
16 17 18 |
# File 'lib/google_distance_matrix/url_builder.rb', line 16 def url @url ||= build_url end |