Sha256: 821d7319e397903824292f6cd3905e95b1c1f12caee17a4429ca2c5c55f4b828

Contents?: true

Size: 1 KB

Versions: 36

Compression:

Stored size: 1 KB

Contents

module Foursquare2
  module Settings

    # Retrive all settings for the authenticated user.

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

    # Retrieve a single setting for the authenticated user.
    #
    # @param [String] setting - The name of the setting to retrieve, one of sendtotwitter, sendtofacebook, pings.

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

    # Update a single setting for the authenticated user.
    #
    # @param [String] setting - The name of the setting to update, one of sendtotwitter, sendtofacebook, pings.
    # @param [String] value - One of '1','0'

    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
    
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
foursquare2-1.9.8 lib/foursquare2/settings.rb
foursquare2-1.9.7 lib/foursquare2/settings.rb
foursquare2-1.9.6 lib/foursquare2/settings.rb
foursquare2-1.9.5 lib/foursquare2/settings.rb
foursquare2-1.9.4 lib/foursquare2/settings.rb
foursquare2-1.9.3 lib/foursquare2/settings.rb
foursquare2-1.9.2 lib/foursquare2/settings.rb
foursquare2-1.9.1 lib/foursquare2/settings.rb
foursquare2-1.9.0 lib/foursquare2/settings.rb
foursquare2-1.8.2 lib/foursquare2/settings.rb
foursquare2-1.8.1 lib/foursquare2/settings.rb
foursquare2-1.8.0 lib/foursquare2/settings.rb
foursquare2-1.7.0 lib/foursquare2/settings.rb
foursquare2-1.6.0 lib/foursquare2/settings.rb
foursquare2-1.5.0 lib/foursquare2/settings.rb
foursquare2-1.4.2 lib/foursquare2/settings.rb
foursquare2-1.4.0 lib/foursquare2/settings.rb
foursquare2-1.3.6 lib/foursquare2/settings.rb
foursquare2-1.3.5 lib/foursquare2/settings.rb
foursquare2-1.3.4 lib/foursquare2/settings.rb