Class: Kerio::Api::Client

Inherits:
Object
  • Object
show all
Includes:
ChainableMethod
Defined in:
lib/kerio-api/client.rb

Instance Method Summary collapse

Methods included from ChainableMethod

#next_method

Constructor Details

#initialize(url: nil, insecure: false, debug: false) ⇒ Client

Create new instance of the client

Parameters:

  • url (URL) (defaults to: nil)

    an URL of the API endpoint

  • insecure (TrueClass) (defaults to: false)

    whether to ignore ssl verification error (true/false)

  • debug (TrueClass) (defaults to: false)

    whether to print json-rpc data sent over network



15
16
17
18
# File 'lib/kerio-api/client.rb', line 15

def initialize (url: nil, insecure: false, debug: false)

	@session = Kerio::Api::Session.new(url, !insecure, debug)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



20
21
22
# File 'lib/kerio-api/client.rb', line 20

def method_missing(method, *args, &block)
	return next_method(names: [method], session: @session, args: args, block: block)
end