Module: Foursquared::Settings

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

Overview

Settings module

Instance Method Summary collapse

Instance Method Details

#all_settingsHash

Returns all settings for the user

Returns:

  • (Hash)


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

def all_settings
  response = get("/settings/all")["response"]["settings"]
end

#set_setting(setting_id, options = {}) ⇒ Hash

Set the value for a setting

Parameters:

  • setting_id (String)

    ID of the setting

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

Options Hash (options):

  • :value (Integer)

    1 for true or 0 for false

Returns:

  • (Hash)

    With a confirmation message



24
25
26
# File 'lib/foursquared/settings.rb', line 24

def set_setting setting_id, options={}
  response = post("/settings/#{setting_id}/set",options)["response"]
end

#setting(setting_id) ⇒ Hash

Return the value for the setting with given ID

Parameters:

  • setting_id (String)

    ID of the setting

Returns:

  • (Hash)

    ex: => “true”



8
9
10
11
# File 'lib/foursquared/settings.rb', line 8

def setting setting_id
  response = get("/settings/#{setting_id}")["response"]
  response
end