Module: Elibom

Defined in:
lib/elibom.rb,
lib/elibom/client.rb

Overview

Ruby client of the Elibom API

Defined Under Namespace

Classes: Client

Class Method Summary collapse

Class Method Details

.configure(options = {}) ⇒ Object



7
8
9
# File 'lib/elibom.rb', line 7

def configure(options={})
  @client = Elibom::Client.new(options)
end

.method_missing(method_name, *args, &block) ⇒ Object

Raises:

  • (RuntimeError)


11
12
13
14
# File 'lib/elibom.rb', line 11

def method_missing(method_name, *args, &block)
  raise RuntimeError, "Please call Elibom.configure(:user => '...', :api_password => '...') first" if @client.nil?
  @client.send(method_name, *args, &block)
end

.reset!Object



21
22
23
# File 'lib/elibom.rb', line 21

def reset!
  @client = nil
end

.respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (RuntimeError)


16
17
18
19
# File 'lib/elibom.rb', line 16

def respond_to_missing?(method_name, include_private=false)
  raise RuntimeError, "Please call Elibom.configure(:user => '...', :api_password => '...') first" if @client.nil?
  @client.respond_to?(method_name, include_private)
end