module Amorail

AmoCRM API integration. www.amocrm.com/

Amorail Exceptions. Every class is name of HTTP response error code(status)

Amorail version

Constants

VERSION

Public Instance Methods

client() click to toggle source
# File lib/amorail.rb, line 31
def client
  ClientRegistry.client || (@client ||= Client.new)
end
config() click to toggle source
# File lib/amorail.rb, line 19
def config
  @config ||= Config.new
end
configure() { |config| ... } click to toggle source
# File lib/amorail.rb, line 27
def configure
  yield(config) if block_given?
end
properties() click to toggle source
# File lib/amorail.rb, line 23
def properties
  client.properties
end
reset() click to toggle source
# File lib/amorail.rb, line 35
def reset
  @config = nil
  @client = nil
end
token_store() click to toggle source
# File lib/amorail.rb, line 55
def token_store
  unless instance_variable_defined?(:@token_store)
    self.token_store = :memory
  end

  @token_store
end
token_store=(args) click to toggle source
# File lib/amorail.rb, line 48
def token_store=(args)
  adapter, options = Array(args)
  @token_store = StoreAdapters.build_by_name(adapter, options)
rescue NameError => e
  raise e.class, "Token store adapter for :#{adapter} haven't been found", e.backtrace
end
with_client(client) { || ... } click to toggle source
# File lib/amorail.rb, line 40
def with_client(client)
  client = Client.new(client) unless client.is_a?(Client)
  ClientRegistry.client = client
  yield
ensure
  ClientRegistry.client = nil
end