Sha256: a32aabf26b4ef007db51a447146e0be74b754960951a6cf4c134e6290ef8eb32
Contents?: true
Size: 1023 Bytes
Versions: 1
Compression:
Stored size: 1023 Bytes
Contents
require 'logger' require 'forwardable' require 'multi_json' require 'keen/client' module Keen class Error < RuntimeError attr_accessor :original_error def initialize(message, _original_error=nil) self.original_error = _original_error super(message) end end class ConfigurationError < Error; end class HttpError < Error; end class BadRequestError < HttpError; end class AuthenticationError < HttpError; end class NotFoundError < HttpError; end class << self extend Forwardable def_delegators :default_client, :project_id, :api_key, :project_id=, :api_key=, :publish, :publish_async attr_writer :logger def logger @logger ||= lambda { logger = Logger.new($stdout) logger.level = Logger::INFO logger }.call end private def default_client @default_client || Keen::Client.new( :project_id => ENV['KEEN_PROJECT_ID'], :api_key => ENV['KEEN_API_KEY'] ) end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
keen-0.4.1 | lib/keen.rb |