Module: Skittles::Client::Special

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

Overview

Define methods related to specials.

Instance Method Summary collapse

Instance Method Details

#flag_special(special_id, venue_id, problem, options = {}) ⇒ Object

Allows users to indicate a special is improper in some way.

Parameters:

  • venue_id (String)

    The id of the venue running the special.

  • problem (String)

    One of not_redeemable, not_valuable, other.

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

    A customizable set of options.

Options Hash (options):

  • text (String)

    Additional text about why the user has flagged this special.

See Also:



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

def flag_special(special_id, venue_id, problem, options = {})
  post("specials/#{special_id}/flag", { :venueId => venue_id, :problem => problem }.merge(options))
  nil
end

#special(special_id, venue_id) ⇒ Hashie::Mash

Gives details about a special, including text and unlock rules.

Parameters:

  • special_id (String)

    Id of special to retrieve.

Returns:

  • (Hashie::Mash)

    A complete special.

See Also:

Requires Acting User:

  • No



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

def special(special_id, venue_id)
  get("specials/#{special_id}", :venueId => venue_id).special
end

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

Note:

This is an experimental API.

Returns a list of specials near the current location.

Parameters:

  • ll (String)

    Latitude and longitude to search near.

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

    A customizable set of options.

Options Hash (options):

  • llAcc (Decimal)

    Accuracy of latitude and longitude, in meters.

  • alt (Decimal)

    Altitude of the user's location, in meters.

  • altAcc (Decimal)

    Accuracy of the user's altitude, in meters.

  • limit (Integer)

    Number of results to return, up to 50.

Returns:

  • (Hashie::Mash)

    An array of specials being run at nearby venues.

See Also:

Requires Acting User:

  • Yes



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

def special_search(ll, options = {})
  get('specials/search', { :ll => ll }.merge(options)).specials
end