Class: Foursquared::Response::ListItem

Inherits:
Object
  • Object
show all
Defined in:
lib/foursquared/response/list_item.rb

Overview

List item response

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#clientObject (readonly)

Returns the value of attribute client.



5
6
7
# File 'lib/foursquared/response/list_item.rb', line 5

def client
  @client
end

#responseObject (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_atTime

The time at which the list item was created

Returns:

  • (Time)


21
22
23
# File 'lib/foursquared/response/list_item.rb', line 21

def created_at
  Time.at(response["createdAt"]) if response["createdAt"]
end

#idString

ID of the list item

Returns:

  • (String)


15
16
17
# File 'lib/foursquared/response/list_item.rb', line 15

def id
  response["id"]
end

#listedArray

Information about what other lists this item appears on

Returns:

  • (Array)

    array of compact lists



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

#noteString

Text entered by the user when creating this item

Returns:

  • (String)


39
40
41
# File 'lib/foursquared/response/list_item.rb', line 39

def note
  response["note"]
end

#photoFoursquared::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

#tipFoursquared::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

#userFoursquared::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

#venueFoursquared::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