Module: Groupon

Defined in:
lib/groupon.rb,
lib/groupon/client.rb,
lib/groupon/version.rb

Defined Under Namespace

Classes: Client, GrouponError

Constant Summary collapse

VERSION =
"1.0.1"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.api_keyString

Get/sets the required Groupon API token

Parameters:

  • (String)

Returns:

  • (String)

See Also:



37
38
39
# File 'lib/groupon.rb', line 37

def api_key
  @api_key
end

Class Method Details

.deals(options = {}) ⇒ Array<Hashie::Mash>

Returns a list of deals.

The API returns an ordered list of deals currently running for a given Division.
Priority is based on position within the response (top deals are higher in priority).

Parameters:

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

    a customizable set of options

Options Hash (options):

  • :lat (String) — default: Latitudinal coordinates based on IP of API request

    Latitude of geolocation to find deals

  • :lng (String) — default: Longtitudinal coordinates based on IP of API request

    Longitude of geolocation to find deals

Returns:

  • (Array<Hashie::Mash>)

    an array of deals

See Also:



26
27
28
# File 'lib/groupon.rb', line 26

def self.deals(options={})
  Groupon::Client.new.deals(options)
end

.divisionsArray<Hashie::Mash>

Returns a list of divisions - cities where Groupon is live.

Returns:

  • (Array<Hashie::Mash>)

    an array of divisions

See Also:



13
14
15
# File 'lib/groupon.rb', line 13

def self.divisions
  Groupon::Client.new.divisions
end