Class: Bento::Analytics

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/bento/analytics.rb,
lib/bento/sdk/utils.rb,
lib/bento/sdk/client.rb,
lib/bento/sdk/worker.rb,
lib/bento/sdk/logging.rb,
lib/bento/sdk/version.rb,
lib/bento/sdk/defaults.rb,
lib/bento/sdk/response.rb,
lib/bento/sdk/transport.rb,
lib/bento/sdk/field_parser.rb,
lib/bento/sdk/message_batch.rb,
lib/bento/sdk/backoff_policy.rb
more...

Defined Under Namespace

Modules: Defaults, Logging, Utils Classes: BackoffPolicy, Client, FieldParser, MessageBatch, PrefixedLogger, Response, Transport, Worker

Constant Summary collapse

VERSION =
"0.1"

Instance Method Summary collapse

Methods included from Logging

included, #logger

Constructor Details

#initialize(options = {}) ⇒ Analytics

Initializes a new instance of Client, to which all method calls are proxied.

Parameters:

Options Hash (options):

  • :stub (Boolean) — default: false

    If true, requests don’t hit the server and are stubbed to be successful.

[View source]

28
29
30
31
# File 'lib/bento/analytics.rb', line 28

def initialize(options = {})
  Transport.stub = options[:stub] if options.key?(:stub)
  @client = Bento::Analytics::Client.new options
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(message, *args, &block) ⇒ Object

[View source]

33
34
35
36
37
38
39
# File 'lib/bento/analytics.rb', line 33

def method_missing(message, *args, &block)
  if @client.respond_to? message
    @client.send message, *args, &block
  else
    super
  end
end

Instance Method Details

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)
[View source]

41
42
43
# File 'lib/bento/analytics.rb', line 41

def respond_to_missing?(method_name, include_private = false)
  @client.respond_to?(method_name) || super
end