Module: PayoneerApi::Utils

Included in:
API::Payees, Client
Defined in:
lib/payoneer_api/utils.rb

Instance Method Summary collapse

Instance Method Details

#bool_to_string(boolean) ⇒ nil, String

Turn a ruby boolean into an XML ‘True’/‘False’ string

Parameters:

  • boolean (Boolean)

    A boolean or nil.

Returns:

  • (nil, String)


7
8
9
10
# File 'lib/payoneer_api/utils.rb', line 7

def bool_to_string(boolean)
  return nil if boolean.nil?
  boolean ? 'True' : 'False'
end

#payout_methods_list(payout_methods) ⇒ Object



12
13
14
15
16
# File 'lib/payoneer_api/utils.rb', line 12

def payout_methods_list(payout_methods)
  payout_methods.is_a?(Array) ?
    payout_methods.join(',') :
    payout_methods.to_s
end

#perform(request_method, options) ⇒ Object

Parameters:

  • request_method (Symbol)
  • options (Hash)


20
21
22
23
# File 'lib/payoneer_api/utils.rb', line 20

def perform(request_method, options)
  request = PayoneerApi::Request.new(self, request_method, options)
  request.perform
end

#perform_with_object(request_method, options, klass) ⇒ Object

Parameters:

  • request_method (Symbol)
  • options (Hash)
  • klass (Class)


28
29
30
31
# File 'lib/payoneer_api/utils.rb', line 28

def perform_with_object(request_method, options, klass)
  request = PayoneerApi::Request.new(self, request_method, options)
  request.perform_with_object(klass)
end