Module: Foursquare2::Settings

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

Instance Method Summary collapse

Instance Method Details

#setting(setting) ⇒ Object

Retrieve a single setting for the authenticated user.

Parameters:

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



15
16
17
18
# File 'lib/foursquare2/settings.rb', line 15

def setting(setting)
  response = connection.get("settings/setting")
  return_error_or_body(response, response.body.response)
end

#settingsObject

Retrive all settings for the authenticated user.



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

def settings
  response = connection.get("settings/all")
  return_error_or_body(response, response.body.response.settings)
end

#update_setting(setting, value) ⇒ 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’



25
26
27
28
29
30
# File 'lib/foursquare2/settings.rb', line 25

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