module OSRM
Constants
- VERSION
Public Class Methods
configuration()
click to toggle source
# File lib/osrm.rb, line 11 def self.configuration Configuration.instance end
configure(options)
click to toggle source
# File lib/osrm.rb, line 7 def self.configure(options) Configuration.instance.merge!(options) end
method_missing(method, *arguments, **keyword_arguments)
click to toggle source
Calls superclass method
# File lib/osrm.rb, line 26 def self.method_missing(method, *arguments, **keyword_arguments) if /^(?<delegate>routes?)_by_(?<profile>[a-z]+)$/ =~ method keyword_arguments[:profile] = profile method(delegate).call(*arguments, **keyword_arguments) else super end end
respond_to_missing?(method, *)
click to toggle source
Calls superclass method
# File lib/osrm.rb, line 35 def self.respond_to_missing?(method, *) /^routes?_by_[a-z]+$/.match(method) || super end
route(*locations, overview: nil, profile: nil)
click to toggle source
# File lib/osrm.rb, line 20 def self.route(*locations, overview: nil, profile: nil) Query.new(*locations) .execute(alternatives: false, overview: overview, profile: profile) .first end
routes(*locations, overview: nil, profile: nil)
click to toggle source
# File lib/osrm.rb, line 15 def self.routes(*locations, overview: nil, profile: nil) Query.new(*locations) .execute(alternatives: true, overview: overview, profile: profile) end