Module: MoloniApi

Defined in:
lib/moloni_api/api.rb,
lib/moloni_api.rb,
lib/moloni_api/client.rb,
lib/moloni_api/version.rb,
lib/moloni_api/constants.rb,
lib/moloni_api/api_exceptions.rb,
lib/moloni_api/models/product.rb,
lib/moloni_api/http_status_codes.rb

Overview

Main client class that implements communication with the API

Defined Under Namespace

Modules: ApiExceptions, Constants, HttpStatusCodes, Models Classes: API, Client, Error

Constant Summary collapse

LIBNAME =
'moloni_api'
LIBDIR =
File.expand_path(LIBNAME.to_s, __dir__)
VERSION =
'0.2.1'

Class Method Summary collapse

Class Method Details

.default_middleware(options = {}) ⇒ Proc

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Default middleware stack that uses default adapter as specified by configuration setup

Returns:

  • (Proc)


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

def default_middleware(options = {})
  Middleware.default(options)
end

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

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Delegate to MoloniApi::Client



41
42
43
44
45
46
47
# File 'lib/moloni_api.rb', line 41

def method_missing(method_name, *args, &block)
  if new.respond_to?(method_name)
    new.send(method_name, *args, &block)
  else
    super.respond_to_missing?
  end
end

.new(options = {}, &block) ⇒ MoloniApi::Client

Alias for MoloniApi::Client.new

Parameters:

  • options (Hash) (defaults to: {})

    the configuration options

Returns:



24
25
26
# File 'lib/moloni_api.rb', line 24

def new(options = {}, &block)
  Client.new(options, &block)
end

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

Returns:

  • (Boolean)


49
50
51
# File 'lib/moloni_api.rb', line 49

def respond_to_missing?(method_name, include_private = false)
  new.respond_to?(method_name, include_private) || super(method_name, include_private)
end