module Snafu::Locations
Public Instance Methods
get_hub(hub_id)
click to toggle source
Accesses the “locations.getStreets” method from the Glitch API passing in the supplied Hub ID.
# File lib/snafu/locations.rb, line 28 def get_hub(hub_id) response = self.call("locations.getStreets", :hub_id => hub_id) Models::Hub.new(response) end
get_hubs()
click to toggle source
Accesses the “locations.getHubs” method from the Glitch API and returns an Array of the returned Hub information.
# File lib/snafu/locations.rb, line 7 def get_hubs hubs = [] response = self.call("locations.getHubs") response["hubs"].each do |key,value| hubs << Models::Hub.new(:id => key, :name => value["name"]) end hubs end
get_hubs!()
click to toggle source
A variant of the get_hubs
method which makes two calls to the Glitch API:
-
locations.getHubs to retrieve all hubs in Glitch
-
locations.getStreets for each hub returned from locations.getHubs
# File lib/snafu/locations.rb, line 21 def get_hubs! # TODO end
get_street(street_id)
click to toggle source
Accesses the “locations.streetInfo” method from the Glitch API padding in the supplied street ID
# File lib/snafu/locations.rb, line 36 def get_street(street_id) response = self.call("locations.streetInfo", :street_tsid => street_id) Models::Street.new(response) end