Class: OutsideIn::Resource::LocationFinder
- Defined in:
- lib/outside_in/resource/location_finder.rb
Overview
A resource that performs queries for locations.
Constant Summary collapse
- QP =
QueryParams.new({:limit => :limit}, {:category => :category})
Class Method Summary collapse
-
.parameterize(url, inputs) ⇒ String
Returns a version of
url
with parameters in the query string corresponding toinputs
. -
.scope(url, inputs) ⇒ String
Returns a version of
url
that includes publication scoping wheninputs
contains a non-nilpublication-id
entry.
Methods inherited from Base
Constructor Details
This class inherits a constructor from OutsideIn::Resource::Base
Class Method Details
.parameterize(url, inputs) ⇒ String
Returns a version of url
with parameters in the query string corresponding to inputs
.
24 25 26 |
# File 'lib/outside_in/resource/location_finder.rb', line 24 def self.parameterize(url, inputs) QP.parameterize(url, inputs) end |
.scope(url, inputs) ⇒ String
Returns a version of url
that includes publication scoping when inputs
contains a non-nil publication-id
entry.
15 16 17 |
# File 'lib/outside_in/resource/location_finder.rb', line 15 def self.scope(url, inputs) inputs['publication-id'].nil?? url : "#{url}/publications/#{inputs['publication-id']}" end |