Module: Foursquare2::Specials

Included in:
Client
Defined in:
lib/foursquare2/specials.rb

Instance Method Summary collapse

Instance Method Details

#add_special(options = {}) ⇒ Object

Add a special for venue managers Details on param options can be found at developer.foursquare.com/docs/specials/add

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • String (Object)

    :name - A name for the special.

  • String (Object)

    :text - Required

  • String (Object)

    :unlockedText - Required. Special text that is shown when the user has unlocked the special.

  • String (Object)

    :finePrint

  • Integer (Object)

    :count1

  • Integer (Object)

    :count2

  • Integer (Object)

    :count3

  • String (Object)

    :type - Required.

  • String (Object)

    :offerId

  • Float (Object)

    :cost



47
48
49
50
51
52
# File 'lib/foursquare2/specials.rb', line 47

def add_special(options={})
  response = connection.post do |req|
    req.url "specials/add", options
  end
    return_error_or_body(response, response.body.response.special)
end

#search_specials(options = {}) ⇒ Object

Search for specials

Parameters:

  • options (Hash) (defaults to: {})

Options Hash (options):

  • String (Object)

    :ll - Latitude and longitude in format LAT,LON

  • Integer (Object)

    :llAcc - Accuracy of the lat/lon in meters.

  • Integer (Object)

    :alt - Altitude in meters

  • Integer (Object)

    :altAcc - Accuracy of the altitude in meters

  • Integer (Object)

    :limit - The limit of results to return.



24
25
26
27
28
29
# File 'lib/foursquare2/specials.rb', line 24

def search_specials(options={})
  response = connection.get do |req|
    req.url "specials/search", options
  end
  return_error_or_body(response, response.body.response.specials.items)
end

#special(special_id, options = {}) ⇒ Object

Retrieve information about a special

param [String] special_id The ID of the special



8
9
10
11
12
13
# File 'lib/foursquare2/specials.rb', line 8

def special(special_id, options={})
  response = connection.get do |req|
    req.url "specials/#{special_id}", options
  end
  return_error_or_body(response, response.body.response.special)
end