Module: ZohoInvoice::Configurable

Included in:
ZohoInvoice, Client
Defined in:
lib/zoho_invoice/configurable.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#apikeyString

Returns The key used to authenticate the API caller.

Returns:

  • (String)

    The key used to authenticate the API caller



11
12
13
# File 'lib/zoho_invoice/configurable.rb', line 11

def apikey
  @apikey
end

#authtokenString

Returns The permanent authtoken used to authenticate each API request.

Returns:

  • (String)

    The permanent authtoken used to authenticate each API request



5
6
7
# File 'lib/zoho_invoice/configurable.rb', line 5

def authtoken
  @authtoken
end

#client_optionsHash

Returns Client configuration to pass to Faraday.

Returns:

  • (Hash)

    Client configuration to pass to Faraday



14
15
16
# File 'lib/zoho_invoice/configurable.rb', line 14

def client_options
  @client_options
end

#scopeString

Returns The value for this parameter has to be invoiceapi.

Returns:

  • (String)

    The value for this parameter has to be invoiceapi



8
9
10
# File 'lib/zoho_invoice/configurable.rb', line 8

def scope
  @scope
end

Class Method Details

.keysObject



18
19
20
21
22
23
24
25
# File 'lib/zoho_invoice/configurable.rb', line 18

def keys
  @keys ||= [
    :authtoken,
    :scope,
    :apikey,
    :client_options
  ]
end

Instance Method Details

#config_hashObject



34
35
36
# File 'lib/zoho_invoice/configurable.rb', line 34

def config_hash
  Hash[ZohoInvoice::Configurable.keys.map{ |key| [key, instance_variable_get(:"@#{key}")] }]
end

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



29
30
31
32
# File 'lib/zoho_invoice/configurable.rb', line 29

def configure
  yield self
  self
end