Class: TicketEvolution::Commissions::CommissionPayments

Inherits:
Endpoint
  • Object
show all
Includes:
Modules::List, Modules::Show
Defined in:
lib/ticket_evolution/commissions/commission_payments.rb

Constant Summary

Constants included from Endpoint::RequestHandler

Endpoint::RequestHandler::CODES

Instance Method Summary collapse

Methods included from Modules::Show

#build_for_show, #show

Methods included from Modules::List

#list, #raw

Methods inherited from Endpoint

#base_path, #connection, #endpoint_name, #has_connection?, #id, #initialize, #method_missing

Methods included from SingularClass

#singular_class

Methods included from Endpoint::RequestHandler

#build_request, #collection_handler, #naturalize_response, #raw_handler, #request, #upload_history_handler

Methods inherited from Base

#method_missing

Constructor Details

This class inherits a constructor from TicketEvolution::Endpoint

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class TicketEvolution::Endpoint

Instance Method Details

#apply(params = {}) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/ticket_evolution/commissions/commission_payments.rb', line 7

def apply(params = {})
  ensure_id
  request(:GET, '/apply', params) do |response|
    singular_class.new(response.body.merge({
      :status_code => response.response_code,
      :server_message => response.server_message,
      :connection => response.body[:connection]
    }))
  end
end

#cancel(params = nil) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/ticket_evolution/commissions/commission_payments.rb', line 18

def cancel(params = nil)
  ensure_id
  request(:GET, "/cancel", nil) do |response|
    singular_class.new(response.body.merge({
      :status_code => response.response_code,
      :server_message => response.server_message,
      :connection => response.body[:connection]
    }))
  end
end