Module: LucidIntercom

Defined in:
lib/lucid_intercom.rb,
lib/lucid_intercom/error.rb,
lib/lucid_intercom/event.rb,
lib/lucid_intercom/types.rb,
lib/lucid_intercom/config.rb,
lib/lucid_intercom/convert.rb,
lib/lucid_intercom/version.rb,
lib/lucid_intercom/response.rb,
lib/lucid_intercom/container.rb,
lib/lucid_intercom/attributes.rb,
lib/lucid_intercom/send_email.rb,
lib/lucid_intercom/update_user.rb,
lib/lucid_intercom/post_request.rb,
lib/lucid_intercom/send_message.rb,
lib/lucid_intercom/render_snippet.rb,
lib/lucid_intercom/user_attributes.rb,
lib/lucid_intercom/notify_installed.rb,
lib/lucid_intercom/company_attributes.rb,
lib/lucid_intercom/notify_uninstalled.rb,
lib/lucid_intercom/notify_changed_plan.rb,
lib/lucid_intercom/company_custom_attributes.rb

Defined Under Namespace

Modules: Types Classes: Attributes, CompanyAttributes, CompanyCustomAttributes, Config, Convert, Event, NotifyChangedPlan, NotifyInstalled, NotifyUninstalled, PostRequest, RenderSnippet, Response, SendEmail, SendMessage, UpdateUser, UserAttributes

Constant Summary collapse

Error =

Subclass this class for all gem exceptions, so that callers may rescue any subclass with:

rescue LucidIntercom::Error => e
Class.new(StandardError)
NotConfiguredError =
Class.new(Error)
VERSION =
'0.13.0'
Container =
Dry::Container.new

Class Method Summary collapse

Class Method Details

.configConfig

Returns:



36
37
38
# File 'lib/lucid_intercom/config.rb', line 36

def config
  @config ||= configure
end

.configure(options = {}) ⇒ Config

Parameters:

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

Returns:



15
16
17
18
19
20
# File 'lib/lucid_intercom/config.rb', line 15

def configure(options = {})
  @config = Config.new(
    **@config.to_h.compact,
    **options,
  )
end

.configure_from_file(path = 'config/intercom.rb') ⇒ Config

Parameters:

  • path (String) (defaults to: 'config/intercom.rb')

Returns:



27
28
29
30
31
# File 'lib/lucid_intercom/config.rb', line 27

def configure_from_file(path = 'config/intercom.rb')
  options = LucidUtils::ConfigFromFile.new.(path, env_prefix: 'intercom')

  configure(options)
end