Class: Recharge::Discount

Inherits:
Object
  • Object
show all
Extended by:
HTTPRequest::Count, HTTPRequest::Create, HTTPRequest::Delete, HTTPRequest::Get, HTTPRequest::List, HTTPRequest::Update
Includes:
Persistable
Defined in:
lib/recharge/classes.rb

Constant Summary collapse

PATH =
"/discounts".freeze
SINGLE =
"discount".freeze
COLLECTION =
"discounts"

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HTTPRequest::Count

count

Methods included from HTTPRequest::Create

create

Methods included from HTTPRequest::Get

get

Methods included from HTTPRequest::List

list

Methods included from HTTPRequest::Update

update

Methods included from Persistable

#save

Class Method Details

.count(options = nil) ⇒ Object



457
458
459
# File 'lib/recharge/classes.rb', line 457

def self.count(options = nil)
  super(convert_date_params(options, :created_at_max, :created_at_min, :date_min, :date_max))
end

.list(options = nil) ⇒ Object



461
462
463
# File 'lib/recharge/classes.rb', line 461

def self.list(options = nil)
  super(convert_date_params(options, :created_at, :created_at_max, :updated_at, :updated_at_max))
end

Instance Method Details

#deleteObject



465
466
467
468
# File 'lib/recharge/classes.rb', line 465

def delete
  self.class.delete(id)
  true
end