Class: GoogleMapsAPI::Directions::Response
- Inherits:
-
Object
- Object
- GoogleMapsAPI::Directions::Response
- Defined in:
- lib/google_maps_api/directions/response.rb
Instance Attribute Summary collapse
-
#routes ⇒ Object
readonly
Returns the value of attribute routes.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(routes, status) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(routes, status) ⇒ Response
Returns a new instance of Response.
7 8 9 10 |
# File 'lib/google_maps_api/directions/response.rb', line 7 def initialize(routes, status) @routes = routes @status = status end |
Instance Attribute Details
#routes ⇒ Object (readonly)
Returns the value of attribute routes.
5 6 7 |
# File 'lib/google_maps_api/directions/response.rb', line 5 def routes @routes end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/google_maps_api/directions/response.rb', line 5 def status @status end |
Class Method Details
.from_json(json) ⇒ Object
12 13 14 15 16 |
# File 'lib/google_maps_api/directions/response.rb', line 12 def self.from_json(json) parsed_json = parse_json(json) routes = build_routes(parsed_json) self.new(routes, parsed_json['status']) end |