Class: Foursquared::Response::ListItem
- Inherits:
-
Object
- Object
- Foursquared::Response::ListItem
- Defined in:
- lib/foursquared/response/list_item.rb
Overview
List item 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
-
#created_at ⇒ Time
The time at which the list item was created.
-
#id ⇒ String
ID of the list item.
-
#initialize(client, response) ⇒ ListItem
constructor
A new instance of ListItem.
-
#listed ⇒ Array
Information about what other lists this item appears on.
-
#note ⇒ String
Text entered by the user when creating this item.
-
#photo ⇒ Foursquared::Response::Photo
A photo for this list item.
-
#tip ⇒ Foursquared::Response::Tip
Tip, if present, in the list.
-
#user ⇒ Foursquared::Response::User
User who added this item to the current list.
-
#venue ⇒ Foursquared::Response::Venue
Venue, if present, in the list.
Constructor Details
#initialize(client, response) ⇒ ListItem
Returns a new instance of ListItem.
7 8 9 10 |
# File 'lib/foursquared/response/list_item.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/list_item.rb', line 5 def client @client end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/foursquared/response/list_item.rb', line 5 def response @response end |
Instance Method Details
#created_at ⇒ Time
The time at which the list item was created
21 22 23 |
# File 'lib/foursquared/response/list_item.rb', line 21 def created_at Time.at(response["createdAt"]) if response["createdAt"] end |
#id ⇒ String
ID of the list item
15 16 17 |
# File 'lib/foursquared/response/list_item.rb', line 15 def id response["id"] end |
#listed ⇒ Array
Information about what other lists this item appears on
57 58 59 |
# File 'lib/foursquared/response/list_item.rb', line 57 def listed response["listed"].collect{|item| Foursquared::Response::List.new(item)} if response["listed"] end |
#note ⇒ String
Text entered by the user when creating this item
39 40 41 |
# File 'lib/foursquared/response/list_item.rb', line 39 def note response["note"] end |
#photo ⇒ Foursquared::Response::Photo
A photo for this list item
51 52 53 |
# File 'lib/foursquared/response/list_item.rb', line 51 def photo Foursquared::Response::Photo.new(client, response["photo"]) if response["photo"] end |
#tip ⇒ Foursquared::Response::Tip
Tip, if present, in the list
27 28 29 |
# File 'lib/foursquared/response/list_item.rb', line 27 def tip Foursquared::Response::Tip.new(client, response["tip"]) if response["tip"] end |
#user ⇒ Foursquared::Response::User
User who added this item to the current list
45 46 47 |
# File 'lib/foursquared/response/list_item.rb', line 45 def user Foursquared::Response::User.new(client, response["user"]) if response["user"] end |
#venue ⇒ Foursquared::Response::Venue
Venue, if present, in the list
33 34 35 |
# File 'lib/foursquared/response/list_item.rb', line 33 def venue Foursquared::Response::Venue.new(client, response["venue"]) if response["venue"] end |