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.



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

def initialize
  self.extra_event_properties  = Proc.new {}
  self.custom_user_traits      = Proc.new {}
  self.error_handler           = Proc.new { |e, msg=""| raise }
  self.track_ajax_as_page_view = false
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

#track_ajax_as_page_viewObject

Returns the value of attribute track_ajax_as_page_view.



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

def track_ajax_as_page_view
  @track_ajax_as_page_view
end

Instance Method Details

#intercom?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/analytics_instrumentation/config.rb', line 36

def intercom?
  Intercom rescue false
end