Module: Skittles::Client::List

Included in:
Skittles::Client
Defined in:
lib/skittles/client/list.rb

Overview

Define methods related to lists.

Instance Method Summary collapse

Instance Method Details

#add_list(name, options = {}) ⇒ Hashie::Mash

Allows users to create a new list.

Options Hash (options):

  • description (String)

    Description of the list.

  • collaborative (String)

    Boolean indicating if this list can be edited by friends.

  • photoId (String)

    The id of a photo that should be set as the list photo.

See Also:

Requires Acting User:

  • Yes


16
17
18
# File 'lib/skittles/client/list.rb', line 16

def add_list(name, options = {})
  post("lists/add", { :name => name }.merge(options)).list
end

#list(id) ⇒ Hashie::Mash

Gives detail about a list.

See Also:

Requires Acting User:

  • No


26
27
28
# File 'lib/skittles/client/list.rb', line 26

def list(id)
  get("lists/#{id}").list
end

#list_followers(id) ⇒ Hashie::Mash

Note:

Only valid on user-created lists.

Returns users following this list.


37
38
39
# File 'lib/skittles/client/list.rb', line 37

def list_followers(id)
  get("lists/#{id}/followers").followers
end

#list_suggestphoto(list_id, item_id) ⇒ Hashie::Mash

Note:

Only valid on user-created lists.

Suggests photos that may be appropriate for this item.


60
61
62
# File 'lib/skittles/client/list.rb', line 60

def list_suggestphoto(list_id, item_id)
  get("lists/#{list_id}/suggestphoto", { :item_id => item_id }).photos
end

#list_suggesttip(list_id, item_id) ⇒ Hashie::Mash

Note:

Only valid on user-created lists.

Suggests tips that may be appropriate for this item.


72
73
74
# File 'lib/skittles/client/list.rb', line 72

def list_suggesttip(list_id, item_id)
  get("lists/#{list_id}/suggesttip", { :item_id => item_id }).tips
end

#list_suggestvenues(id) ⇒ Hashie::Mash

Note:

Only valid on user-created lists.

Suggests venues that may be appropriate for this list.


48
49
50
# File 'lib/skittles/client/list.rb', line 48

def list_suggestvenues(id)
  get("lists/#{id}/suggestvenues").suggestedVenues
end