Module: Skittles::Client::Tip

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

Overview

Define methods related to tips.

See Also:

Instance Method Summary (collapse)

Instance Method Details

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

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

Parameters:

  • id (String)

    The venue where you want to add this tip.

  • text (String)

    The text of the tip.

  • options (Hash) (defaults to: {})

    A customizable set of options.

Options Hash (options):

  • url (String)

    A URL related to this tip.

Returns:

  • (Hashie::Mash)

    The newly-added 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

- (Hashie::Mash) tip(id)

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

Parameters:

  • id (String)

    Id of tip to retrieve.

Returns:

  • (Hashie::Mash)

    A complete tip.

See Also:

Requires Acting User:

  • No



29
30
31
# File 'lib/skittles/client/tip.rb', line 29

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

- (Hashie::Mash) tip_markdone(id)

Allows the acting user to mark a tip done.

Parameters:

  • id (String)

    The tip you want to mark done.

Returns:

  • (Hashie::Mash)

    The marked to-do.

See Also:

Requires Acting User:

  • Yes



39
40
41
# File 'lib/skittles/client/tip.rb', line 39

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

- (Hashie::Mash) tip_marktodo(id)

Allows you to mark a tip to-do.

Parameters:

  • id (String)

    The tip you want to mark to-do.

Returns:

  • (Hashie::Mash)

    The newly-added to-do.

See Also:

Requires Acting User:

  • Yes



49
50
51
# File 'lib/skittles/client/tip.rb', line 49

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

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

Returns a list of tips near the area specified.

Parameters:

  • ll (String)

    Latitude and longitude of the user's location.

  • options (Hash) (defaults to: {})

    A customizable set of options.

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.

Returns:

  • (Hashie::Mash)

    An array of tips, each of which contain a user and venue.

See Also:

Requires Acting User:

  • No



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

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

- (Hashie::Mash) tip_unmark(id)

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

Parameters:

  • id (String)

    The tip you want to unmark.

Returns:

  • (Hashie::Mash)

    The tip being acted on.

See Also:

Requires Acting User:

  • No



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

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