Module: ViglinkApi::Deal

Included in:
Client
Defined in:
lib/viglink_api/deal.rb

Instance Method Summary collapse

Instance Method Details

#find_deal_types(options = {}) ⇒ Hashie::Mash

Retrieve the list of Deal Types

the complete response

Parameters:

  • :full (Boolean)

    If set to true|y|yes then this will return

Returns:

  • (Hashie::Mash)

    DealType



32
33
34
35
36
37
38
39
40
41
42
# File 'lib/viglink_api/deal.rb', line 32

def find_deal_types(options = {})
  full_response = options.delete(:full) if options[:full]
  options[:key] = @api_key
  deal_types_response = get('/vigcatalog/deal_types.xml', options)

  if full_response.to_s.to_bool or @api_full_response
    deal_types_response.response if deal_types_response.response
  else
    deal_types_response.response.results.deal_types if deal_types_response.response.results
  end
end

#find_deals(options = {}) ⇒ Hashie::Mash

Retrieve the list of Deals

the complete response

Parameters:

  • :full (Boolean)

    If set to true|y|yes then this will return

Returns:

  • (Hashie::Mash)

    Deal



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/viglink_api/deal.rb', line 13

def find_deals(options={})
  full_response = options.delete(:full) if options[:full]
  options[:key] = @api_key
  deals_response = get('/vigcatalog/deals.xml', options)

  if full_response.to_s.to_bool or @api_full_response
    deals_response.response if deals_response.response
  else
    deals_response.response.results.deals if deals_response.response.results
  end
end