Class: Foursquared::Response::Special
- Inherits:
-
Object
- Object
- Foursquared::Response::Special
- Defined in:
- lib/foursquared/response/special.rb
Overview
Special response
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#description ⇒ String
A description of how to unlock the special.
-
#detail ⇒ String
Minutes remaining until the special can be unlocked.
-
#fine_print ⇒ String
The specific rules for this special.
-
#flag(options = {}) ⇒ Object
Flag the Special.
-
#friends_here ⇒ Array<Foursquared::Response::User>
Friends who are here.
-
#icon ⇒ String
The name of the icon to use.
-
#icon_url ⇒ String
URL for the icon.
-
#id ⇒ String
ID of the special.
-
#image_urls ⇒ Hash
The count and urls for the images for the special.
-
#initialize(client, response) ⇒ Special
constructor
A new instance of Special.
-
#message ⇒ String
A message describing the special.
-
#progress ⇒ Integer
A description of how close you are to unlocking the special.
-
#progress_description ⇒ String
A label describing what the number in the progress field means.
-
#provider ⇒ String
The provider of the special.
-
#redemption ⇒ String
Type of redemption.
-
#state ⇒ String
The state of the special.
-
#title ⇒ String
The header text describing the type of special.
-
#type ⇒ String
One of mayor, count, frequency, regular, friends, swarm, flash or other.
-
#unlocked? ⇒ Boolean
If the user has unlocked the special.
Constructor Details
#initialize(client, response) ⇒ Special
Returns a new instance of Special.
7 8 9 10 |
# File 'lib/foursquared/response/special.rb', line 7 def initialize client, response @client = client @response = response end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/foursquared/response/special.rb', line 5 def client @client end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/foursquared/response/special.rb', line 5 def response @response end |
Instance Method Details
#description ⇒ String
A description of how to unlock the special.
20 21 22 |
# File 'lib/foursquared/response/special.rb', line 20 def description response["description"] end |
#detail ⇒ String
Minutes remaining until the special can be unlocked
86 87 88 |
# File 'lib/foursquared/response/special.rb', line 86 def detail response["detail"] end |
#fine_print ⇒ String
The specific rules for this special.
110 111 112 |
# File 'lib/foursquared/response/special.rb', line 110 def fine_print response["finePrint"] end |
#flag(options = {}) ⇒ Object
Flag the Special
125 126 127 |
# File 'lib/foursquared/response/special.rb', line 125 def flag ={} response = post("/specials/#{id}/flag", )["response"] end |
#friends_here ⇒ Array<Foursquared::Response::User>
Friends who are here
116 117 118 |
# File 'lib/foursquared/response/special.rb', line 116 def friends_here @friends = response["friendsHere"].collect{|friend| Foursquared::Response::User.new(client, friend)} end |
#icon ⇒ String
The name of the icon to use
50 51 52 |
# File 'lib/foursquared/response/special.rb', line 50 def icon response["icon"] end |
#icon_url ⇒ String
URL for the icon
56 57 58 |
# File 'lib/foursquared/response/special.rb', line 56 def icon_url "http://foursquare.com/img/specials/#{icon}.png" if icon end |
#id ⇒ String
ID of the special
14 15 16 |
# File 'lib/foursquared/response/special.rb', line 14 def id response["id"] end |
#image_urls ⇒ Hash
The count and urls for the images for the special
38 39 40 |
# File 'lib/foursquared/response/special.rb', line 38 def image_urls response["imageUrls"] end |
#message ⇒ String
A message describing the special.
32 33 34 |
# File 'lib/foursquared/response/special.rb', line 32 def response["message"] end |
#progress ⇒ Integer
A description of how close you are to unlocking the special
74 75 76 |
# File 'lib/foursquared/response/special.rb', line 74 def progress response["progress"] end |
#progress_description ⇒ String
A label describing what the number in the progress field means.
80 81 82 |
# File 'lib/foursquared/response/special.rb', line 80 def progress_description response["progressDescription"] end |
#provider ⇒ String
The provider of the special
92 93 94 |
# File 'lib/foursquared/response/special.rb', line 92 def provider response["provider"] end |
#redemption ⇒ String
Type of redemption
98 99 100 |
# File 'lib/foursquared/response/special.rb', line 98 def redemption response["redemption"] end |
#state ⇒ String
The state of the special
68 69 70 |
# File 'lib/foursquared/response/special.rb', line 68 def state response["state"] end |
#title ⇒ String
The header text describing the type of special.
62 63 64 |
# File 'lib/foursquared/response/special.rb', line 62 def title response["title"] end |
#type ⇒ String
One of mayor, count, frequency, regular, friends, swarm, flash or other.
26 27 28 |
# File 'lib/foursquared/response/special.rb', line 26 def type response["type"] end |
#unlocked? ⇒ Boolean
If the user has unlocked the special
44 45 46 |
# File 'lib/foursquared/response/special.rb', line 44 def unlocked? response["unlocked"] end |