Class: Foursquare::Settings
- Inherits:
-
Object
- Object
- Foursquare::Settings
- Defined in:
- lib/foursquare/settings.rb
Instance Method Summary collapse
- #fetch ⇒ Object
-
#initialize(foursquare, json = {}) ⇒ Settings
constructor
A new instance of Settings.
- #receive_comment_pings? ⇒ Boolean
- #receive_pings? ⇒ Boolean
- #send_to_facebook? ⇒ Boolean
- #send_to_twitter? ⇒ Boolean
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
#fetch ⇒ Object
7 8 9 |
# File 'lib/foursquare/settings.rb', line 7 def fetch @json = @foursquare.get('settings/all')["settings"] end |
#receive_comment_pings? ⇒ 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
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
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
21 22 23 24 |
# File 'lib/foursquare/settings.rb', line 21 def send_to_twitter? fetch unless @json.has_key?('sendToTwitter') @json['sendToTwitter'] end |