Module: Skittles::Client::Tip

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

Overview

Define methods related to tips.

Instance Method Summary collapse

Instance Method Details

#add_tip(id, text, options = {}) ⇒ Hashie::Mash

Allows a user to add a new tip at a venue.

Options Hash (options):

  • url (String)

    A URL related to this tip.

See Also:

Requires Acting User:

  • Yes



15
16
17
18
19
20
# File 'lib/skittles/client/tip.rb', line 15

def add_tip(id, text, options = {})
  post("tips/add", {
    :venueId => id,
    :text => text
  }.merge(options)).tip
end

#done_tip(id, options = {}) ⇒ Object

Returns an array of users who have done a tip.

Options Hash (options):

  • limit (Integer)

    Number of results to return, up to 200.

  • offset (Integer)

    Used to page through results.

See Also:

Requires Acting User:

  • No



31
32
33
# File 'lib/skittles/client/tip.rb', line 31

def done_tip(id, options = {})
  get("tips/#{id}/done", options).users
end

#like_tip(id, set = 1) ⇒ Hashie::Mash

Allows a user to like or unlike a tip.

See Also:

Requires Acting User:

  • Yes



42
43
44
# File 'lib/skittles/client/tip.rb', line 42

def like_tip(id, set = 1)
  post("tips/#{id}/like", { :set => set }).likes
end

#tip(id) ⇒ Hashie::Mash

Gives details about a tip, including which users (especially friends) have marked the tip to-do or done.

See Also:

Requires Acting User:

  • No



53
54
55
# File 'lib/skittles/client/tip.rb', line 53

def tip(id)
  get("tips/#{id}").tip
end

#tip_likes(id) ⇒ Hashie::Mash

Returns friends and a total count of users who have liked this tip.

See Also:

Requires Acting User:

  • No



63
64
65
# File 'lib/skittles/client/tip.rb', line 63

def tip_likes(id)
  get("tips/#{id}/likes").likes
end

#tip_listed(id, options = {}) ⇒ Object

The lists that a tip appears on.

Options Hash (options):

  • group (String)

    Either created, edited, followed, friends or suggested.

See Also:



75
76
77
# File 'lib/skittles/client/tip.rb', line 75

def tip_listed(id, options = {})
  get("tips/#{id}/listed", options).lists
end

#tip_markdone(id) ⇒ Hashie::Mash

Deprecated.

Allows the acting user to mark a tip done.

See Also:

Requires Acting User:

  • Yes



86
87
88
# File 'lib/skittles/client/tip.rb', line 86

def tip_markdone(id)
  post("tips/#{id}/markdone").todo
end

#tip_marktodo(id) ⇒ Hashie::Mash

Deprecated.

Allows you to mark a tip to-do.

See Also:

Requires Acting User:

  • Yes



97
98
99
# File 'lib/skittles/client/tip.rb', line 97

def tip_marktodo(id)
  post("tips/#{id}/marktodo").todo
end

#tip_search(ll, options = {}) ⇒ Hashie::Mash

Returns a list of tips near the area specified.

Options Hash (options):

  • limit (Integer)

    Number of results to return, up to 500.

  • offset (Integer)

    Used to page through results.

  • filter (String)

    If set to friends, only show nearby tips from friends.

  • query (String)

    Only find tips matching the given term, cannot be used in conjunction with friends filter.

See Also:

Requires Acting User:

  • No



112
113
114
# File 'lib/skittles/client/tip.rb', line 112

def tip_search(ll, options = {})
  get("tips/search", { :ll => ll }.merge(options)).tips
end

#tip_unmark(id) ⇒ Hashie::Mash

Deprecated.

Allows you to remove a tip from your to-do list or done list.

See Also:

Requires Acting User:

  • No



123
124
125
# File 'lib/skittles/client/tip.rb', line 123

def tip_unmark(id)
  post("tips/#{id}/unmark").tip
end