Class: AnalyticsInstrumentation::Config

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Validations
Defined in:
lib/analytics_instrumentation/config.rb

Defined Under Namespace

Classes: Invalid

Constant Summary collapse

@@REQUIRED_CALLABLES =
[
  :extra_event_properties,
  :custom_user_traits,
  :error_handler
]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



28
29
30
31
32
# File 'lib/analytics_instrumentation/config.rb', line 28

def initialize
  self.extra_event_properties = Proc.new {}
  self.custom_user_traits     = Proc.new {}
  self.error_handler          = Proc.new { |e, msg=""| raise }
end

Instance Attribute Details

#custom_user_traitsObject

Returns the value of attribute custom_user_traits.



8
9
10
# File 'lib/analytics_instrumentation/config.rb', line 8

def custom_user_traits
  @custom_user_traits
end

#error_handlerObject

Returns the value of attribute error_handler.



9
10
11
# File 'lib/analytics_instrumentation/config.rb', line 9

def error_handler
  @error_handler
end

#extra_event_propertiesObject

Returns the value of attribute extra_event_properties.



7
8
9
# File 'lib/analytics_instrumentation/config.rb', line 7

def extra_event_properties
  @extra_event_properties
end

#segment_write_keyObject

Returns the value of attribute segment_write_key.



10
11
12
# File 'lib/analytics_instrumentation/config.rb', line 10

def segment_write_key
  @segment_write_key
end

Instance Method Details

#intercom?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/analytics_instrumentation/config.rb', line 34

def intercom?
  Intercom rescue false
end