Module: Close

Defined in:
lib/close/filter.rb,
lib/close.rb,
lib/close/errors.rb,
lib/close/version.rb,
lib/close/api_resource.rb,
lib/close/close_object.rb,
lib/close/resource/lead.rb,
lib/close/resource/task.rb,
lib/close/resource/user.rb,
lib/close/api_operations.rb,
lib/close/resource/contact.rb,
lib/close/resource/activity.rb,
lib/close/resource/opportunity.rb,
lib/close/resource/organization.rb,
lib/close/resource/custom_activity.rb,
lib/close/resource/custom_activity_type.rb

Overview

This class attempts to abstract away the Advanced Filter API. It is very powerful and fast, but building the queries is very tedious. It allows to store preset queries as JSON for common queries that can be commited to the repo and validated. It also lets you define queries on the fly which can then be reused across the codebase without having to copy and paste the query all the time.

Defined Under Namespace

Modules: APIOperations Classes: APIError, APIResource, Activity, AuthenticationError, CloseObject, Contact, CustomActivity, CustomActivityType, Error, Filter, InvalidRequestError, Lead, MissingParameterError, Opportunity, Organization, QueryNotFoundError, RateLimitExceeded, Task, User

Constant Summary collapse

VERSION =
"0.9.0"

Class Method Summary collapse

Class Method Details

.configurationObject

The default configuration object.

Parameters:

  • api_key (Hash)

    a customizable set of options

  • rate_limit_behavior (Hash)

    a customizable set of options

  • logger (Hash)

    a customizable set of options



20
21
22
23
24
25
26
# File 'lib/close.rb', line 20

def self.configuration
  @@configuration ||= OpenStruct.new({
    api_key: ENV['CLOSE_API_KEY'],
    rate_limit: :raise_error,
    logger: Logger.new(STDOUT),
  })
end

.configure {|configuration| ... } ⇒ Object

Allow block setting of configuration options.

Yields:



29
30
31
# File 'lib/close.rb', line 29

def self.configure
  yield(configuration)
end