class Rome2rio::Route

Attributes

distance[R]
duration[R]
name[R]
segments[R]
stops[R]

Public Class Methods

new(json) click to toggle source
# File lib/rome2rio/response/route.rb, line 4
def initialize(json)
  @name = json["name"]
  @distance = json["distance"]
  @duration = json["duration"]
  @stops = []
  json["stops"].each { |stop| @stops << Stop.new(stop) }
  @segments = []
  json["segments"].each { |segment| @segments << Segment.new(segment) }
end