Class: ZohoInvoiceResource::Connection

Inherits:
ActiveResource::Connection
  • Object
show all
Defined in:
lib/zoho_invoice_resource/connection.rb

Constant Summary collapse

DEBUG =
false

Instance Method Summary collapse

Instance Method Details

#httpObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/zoho_invoice_resource/connection.rb', line 4

def http
  configure_http(new_http).tap do |h|
    if DEBUG
      if h.respond_to?(:set_debug_output)
        h.set_debug_output($stderr)
      elsif h.respond_to?(:debug_output=) # for ActiveResource::Persistent::HTTP
        h.debug_output = $stderr
      end
    end
  end
end

#http_format_header(http_method) ⇒ Object



16
17
18
# File 'lib/zoho_invoice_resource/connection.rb', line 16

def http_format_header(http_method)
  {HTTP_FORMAT_HEADER_NAMES[http_method] => format.mime_type(http_method)}
end