Class: OutsideIn::Resource::LocationFinder

Inherits:
Base
  • Object
show all
Defined in:
lib/outside_in/resource/location_finder.rb

Overview

A resource that performs queries for locations.

Since:

  • 1.0

Constant Summary collapse

QP =

Since:

  • 1.0

QueryParams.new({:limit => :limit}, {:category => :category})

Class Method Summary collapse

Methods inherited from Base

#GET, #initialize, sign

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.

Returns:

  • (String)

    the URL including query parameters

Since:

  • 1.0



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.

Returns:

  • (String)

    the potentially scoped URL

Since:

  • 1.0



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