Class: Foursquare::Settings

Inherits:
Object
  • Object
show all
Defined in:
lib/foursquare/settings.rb

Instance Method Summary collapse

Constructor Details

#initialize(foursquare, json = {}) ⇒ Settings

Returns a new instance of Settings.



3
4
5
# File 'lib/foursquare/settings.rb', line 3

def initialize(foursquare, json={})
  @foursquare, @json = foursquare, json
end

Instance Method Details

#fetchObject



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

def fetch
  @json = @foursquare.get('settings/all')["settings"]
end

#receive_comment_pings?Boolean

Returns:

  • (Boolean)


16
17
18
19
# File 'lib/foursquare/settings.rb', line 16

def receive_comment_pings?
  fetch unless @json.has_key?('receiveCommentPings')
  @json['receiveCommentPings']
end

#receive_pings?Boolean

Returns:

  • (Boolean)


11
12
13
14
# File 'lib/foursquare/settings.rb', line 11

def receive_pings?
  fetch unless @json.has_key?('receivePings')
  @json['receivePings']
end

#send_to_facebook?Boolean

Returns:

  • (Boolean)


26
27
28
29
# File 'lib/foursquare/settings.rb', line 26

def send_to_facebook?
  fetch unless @json.has_key?('sendToFacebook')
  @json['sendToFacebook']
end

#send_to_twitter?Boolean

Returns:

  • (Boolean)


21
22
23
24
# File 'lib/foursquare/settings.rb', line 21

def send_to_twitter?
  fetch unless @json.has_key?('sendToTwitter')
  @json['sendToTwitter']
end