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
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
Sets the logger instance for the Projector
SDK @return [Logger]
# File lib/projector.rb, line 46 def logger=(x) @logger = x end
Delegate to an instance of {Projector::Client}
# 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
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
Forward respond_to? to an instance of {Projector::Client}.
# File lib/projector.rb, line 27 def respond_to?(method, include_private = false) new.respond_to?(method, include_private) || super(method, include_private) end