Class: Pingpp::CouponTemplate

Inherits:
AppBasedResource show all
Extended by:
APIOperations::Create, APIOperations::List
Includes:
APIOperations::Delete, APIOperations::Update
Defined in:
lib/pingpp/coupon_template.rb

Class Method Summary collapse

Methods included from APIOperations::Create

create

Methods included from APIOperations::List

list

Methods included from APIOperations::Update

included, #save

Methods included from APIOperations::Delete

included

Methods inherited from AppBasedResource

resource_url

Methods inherited from APIResource

class_name, #refresh, resource_url, #resource_url, retrieve, uri_object_name

Methods included from APIOperations::Request

included

Methods inherited from PingppObject

#==, #[], #[]=, #_dump, _load, #as_json, construct_from, #each, #initialize, #inspect, #keys, #refresh_from, #respond_to?, #serialize_params, #to_hash, #to_json, #to_s, #values

Constructor Details

This class inherits a constructor from Pingpp::PingppObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Pingpp::PingppObject

Class Method Details

.create_coupons(coupon_template, params = {}, opts = {}) ⇒ Object



18
19
20
21
# File 'lib/pingpp/coupon_template.rb', line 18

def self.create_coupons(coupon_template, params={}, opts={})
  response, opts = request(:post, coupon_url(coupon_template, opts), params, opts)
  Util.convert_to_pingpp_object(response, opts)
end

.list_coupons(coupon_template, filters = {}, opts = {}) ⇒ Object



12
13
14
15
16
# File 'lib/pingpp/coupon_template.rb', line 12

def self.list_coupons(coupon_template, filters={}, opts={})
  opts = Util.normalize_opts(opts)
  response, opts = request(:get, coupon_url(coupon_template, opts), filters, opts)
  ListObject.construct_from(response, opts)
end

.object_nameObject



8
9
10
# File 'lib/pingpp/coupon_template.rb', line 8

def self.object_name
  'coupon_template'
end