Class: Kiik::Compensation
- Includes:
- Rest::GetAll
- Defined in:
- lib/kiik/compensation.rb
Instance Attribute Summary collapse
-
#aditional_info ⇒ Object
Returns the value of attribute aditional_info.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#charge_id ⇒ Object
Returns the value of attribute charge_id.
-
#compensated_at ⇒ Object
Returns the value of attribute compensated_at.
-
#expected_compensation_date ⇒ Object
Returns the value of attribute expected_compensation_date.
-
#history_type ⇒ Object
Returns the value of attribute history_type.
-
#received_at ⇒ Object
Returns the value of attribute received_at.
-
#status ⇒ Object
Returns the value of attribute status.
-
#total ⇒ Object
Returns the value of attribute total.
Attributes inherited from Resource
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Compensation
constructor
A new instance of Compensation.
- #to_json ⇒ Object
Methods included from Rest::GetAll
Methods inherited from Resource
build, class_name, opts, request, url, #valid?
Constructor Details
#initialize(attributes = {}) ⇒ Compensation
Returns a new instance of Compensation.
22 23 24 |
# File 'lib/kiik/compensation.rb', line 22 def initialize(attributes = {}) super(attributes) end |
Instance Attribute Details
#aditional_info ⇒ Object
Returns the value of attribute aditional_info.
5 6 7 |
# File 'lib/kiik/compensation.rb', line 5 def aditional_info @aditional_info end |
#amount ⇒ Object
Returns the value of attribute amount.
5 6 7 |
# File 'lib/kiik/compensation.rb', line 5 def amount @amount end |
#charge_id ⇒ Object
Returns the value of attribute charge_id.
5 6 7 |
# File 'lib/kiik/compensation.rb', line 5 def charge_id @charge_id end |
#compensated_at ⇒ Object
Returns the value of attribute compensated_at.
5 6 7 |
# File 'lib/kiik/compensation.rb', line 5 def compensated_at @compensated_at end |
#expected_compensation_date ⇒ Object
Returns the value of attribute expected_compensation_date.
5 6 7 |
# File 'lib/kiik/compensation.rb', line 5 def expected_compensation_date @expected_compensation_date end |
#history_type ⇒ Object
Returns the value of attribute history_type.
5 6 7 |
# File 'lib/kiik/compensation.rb', line 5 def history_type @history_type end |
#received_at ⇒ Object
Returns the value of attribute received_at.
5 6 7 |
# File 'lib/kiik/compensation.rb', line 5 def received_at @received_at end |
#status ⇒ Object
Returns the value of attribute status.
5 6 7 |
# File 'lib/kiik/compensation.rb', line 5 def status @status end |
#total ⇒ Object
Returns the value of attribute total.
5 6 7 |
# File 'lib/kiik/compensation.rb', line 5 def total @total end |
Class Method Details
.consolidated(customer = nil, start_date = nil, end_date = nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/kiik/compensation.rb', line 9 def consolidated(customer = nil, start_date = nil, end_date = nil) url = customer.nil? ? '' : "#{customer}/" url += "consolidated" params = [] params << "start_date=#{start_date.strftime('%Y-%m-%d %H:%M:%S')}" if start_date params << "end_date=#{end_date.strftime('%Y-%m-%d %H:%M:%S')}" if end_date url += "?#{params.join('&')}" if params.length result = request(url, {}, :GET, {}) raise result if result.kind_of? StandardError result.total end |
Instance Method Details
#to_json ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/kiik/compensation.rb', line 26 def to_json super.merge!(super([ :status, :received_at, :history_type, :expected_compensation_date, :compensated_at, :charge_id, :amount, :aditional_info ])) end |