module Projector

Main interface for interacting with the Projector SDK. This class forwards method calls to an internal instance of {Projector::Client}, allowing you to make calls like {Projector::ApiMethods#deliver_event Projector.deliver_event(event)} without explicitly constructing an instance. Instances constructed in this way will use the default options specified using either {Projector::Client 12-factor environment variables} or via {Projector::Client.configure}.

If you wish to keep a persistent {Projector::Client} instance for some reason, construct it using {Projector::Client#initialize new Projector::Client(options)}.

Constants

API_VERSION

Current API Version

VERSION

Current SDK Version

Public Class Methods

logger() click to toggle source

The Logger instance for internal logging. Defaults to the Rails logger or STDOUT. @return [Logger]

# File lib/projector.rb, line 33
def logger
  @logger ||= begin
                if defined?(::Rails)
                  Rails.logger
                else
                  require 'logger'
                  ::Logger.new(STDOUT)
                end
              end
end
logger=(x) click to toggle source

Sets the logger instance for the Projector SDK @return [Logger]

# File lib/projector.rb, line 46
def logger=(x)
  @logger = x
end
method_missing(method, *args, &block) click to toggle source

Delegate to an instance of {Projector::Client}

Calls superclass method
# File lib/projector.rb, line 21
def method_missing(method, *args, &block)
  return super unless new.respond_to?(method)
  new.send(method, *args, &block)
end
new(options = {}) click to toggle source

Alias for Projector::Client.new

@param [Hash] options configuration options @return [Projector::Client]

# File lib/projector.rb, line 16
def new(options = {})
  Projector::Client.new(options)
end
respond_to?(method, include_private = false) click to toggle source

Forward respond_to? to an instance of {Projector::Client}.

Calls superclass method
# File lib/projector.rb, line 27
def respond_to?(method, include_private = false)
  new.respond_to?(method, include_private) || super(method, include_private)
end