Class: BrmClient::Logger

Inherits:
Object
  • Object
show all
Includes:
Event
Defined in:
lib/brm_client/logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Event

#action, #connect, #create, #delete, #describe, #location, #message, #register_event, #resource_event, #session_event, #session_expired, #share, #sign_in, #sign_in_failed, #sign_out, #sign_up, #system, #transaction, #unsubscribe, #update

Constructor Details

#initialize(application, gateway_options = {}, opts = {}) ⇒ Logger

Returns a new instance of Logger.



13
14
15
16
17
18
19
20
21
# File 'lib/brm_client/logger.rb', line 13

def initialize(application, gateway_options = {}, opts={})
  @application = application
  @options = {
   :timestamp_format => "timestamp"
  }.merge(opts)
  gateway_type = gateway_options.delete(:type) || "File"
  gateway_options[:application] ||= application
  @gateway = BrmClient::Gateway.const_get(gateway_type).new(gateway_options)
end

Instance Attribute Details

#applicationObject (readonly)

Returns the value of attribute application.



10
11
12
# File 'lib/brm_client/logger.rb', line 10

def application
  @application
end

#facet_idObject

Returns the value of attribute facet_id.



11
12
13
# File 'lib/brm_client/logger.rb', line 11

def facet_id
  @facet_id
end

#gatewayObject (readonly)

Returns the value of attribute gateway.



10
11
12
# File 'lib/brm_client/logger.rb', line 10

def gateway
  @gateway
end

#user_idObject

Returns the value of attribute user_id.



11
12
13
# File 'lib/brm_client/logger.rb', line 11

def user_id
  @user_id
end

Instance Method Details

#disconnectObject



23
24
25
# File 'lib/brm_client/logger.rb', line 23

def disconnect
  @gateway.disconnect
end

#sequence_numberObject



5
6
7
8
# File 'lib/brm_client/logger.rb', line 5

def sequence_number
  @sequence_number ||= 0
  @sequence_number += 1
end