Module: Foursquare2::Settings

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

Instance Method Summary collapse

Instance Method Details

#setting(setting, options = {}) ⇒ Object

Retrieve a single setting for the authenticated user.

Parameters:

  • setting (String)
    • The name of the setting to retrieve, one of sendtotwitter, sendtofacebook, pings.



17
18
19
20
21
22
# File 'lib/foursquare2/settings.rb', line 17

def setting(setting, options={})
  response = connection.get do |req|
    req.url "settings/setting", options
  end
  return_error_or_body(response, response.body.response)
end

#settings(options = {}) ⇒ Object

Retrive all settings for the authenticated user.



6
7
8
9
10
11
# File 'lib/foursquare2/settings.rb', line 6

def settings(options={})
  response = connection.get do |req|
    req.url "settings/all", options
  end
  return_error_or_body(response, response.body.response.settings)
end

#update_setting(setting, value, options = {}) ⇒ Object

Update a single setting for the authenticated user.

Parameters:

  • setting (String)
    • The name of the setting to update, one of sendtotwitter, sendtofacebook, pings.

  • value (String)
    • One of ‘1’,‘0’



29
30
31
32
33
34
# File 'lib/foursquare2/settings.rb', line 29

def update_setting(setting, value, options={})
  response = connection.post do |req|
    req.url "settings/#{setting}/set", {:value => value}.merge(options)
  end
  return_error_or_body(response, response.body.response)
end