Class: AhoyCaptain::Configuration
- Inherits:
-
Object
- Object
- AhoyCaptain::Configuration
- Defined in:
- lib/ahoy_captain/configuration.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
-
#disabled_widgets ⇒ Object
Returns the value of attribute disabled_widgets.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#filters ⇒ Object
readonly
Returns the value of attribute filters.
-
#funnels ⇒ Object
readonly
Returns the value of attribute funnels.
-
#goals ⇒ Object
readonly
Returns the value of attribute goals.
-
#models ⇒ Object
readonly
Returns the value of attribute models.
-
#predicate_labels ⇒ Object
readonly
Returns the value of attribute predicate_labels.
-
#ranges ⇒ Object
readonly
Returns the value of attribute ranges.
-
#realtime_interval ⇒ Object
Returns the value of attribute realtime_interval.
-
#theme ⇒ Object
Returns the value of attribute theme.
-
#view_name ⇒ Object
Returns the value of attribute view_name.
Instance Method Summary collapse
- #funnel(id, &block) ⇒ Object
- #goal(id, &block) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/ahoy_captain/configuration.rb', line 8 def initialize @goals = GoalCollection.new @funnels = FunnelCollection.new @theme = "dark" @ranges = ::AhoyCaptain::PeriodCollection.load_default @cache = ActiveSupport::OrderedOptions.new.tap do |option| option.enabled = false option.store = Rails.cache option.ttl = 1.minute end @models = ActiveSupport::OrderedOptions.new.tap do |option| option.event = "::Ahoy::Event" option.visit = "::Ahoy::Visit" end @event = ActiveSupport::OrderedOptions.new.tap do |option| option.view_name = "$view" option.url_column = "CONCAT(#{@models.event.parameterize.tableize}.properties->>'controller', '#', #{@models.event.parameterize.tableize}.properties->>'action')" option.url_exists = "JSONB_EXISTS(#{@models.event.parameterize.tableize}.properties, 'controller') AND JSONB_EXISTS(#{@models.event.parameterize.tableize}.properties, 'action')" end @filters = FiltersConfiguration.load_default @predicate_labels = { eq: 'equals', not_eq: 'not equals', cont: 'contains', in: 'in', not_in: 'not in', } @realtime_interval = 30.seconds @disabled_widgets = [] end |
Instance Attribute Details
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
7 8 9 |
# File 'lib/ahoy_captain/configuration.rb', line 7 def cache @cache end |
#disabled_widgets ⇒ Object
Returns the value of attribute disabled_widgets.
6 7 8 |
# File 'lib/ahoy_captain/configuration.rb', line 6 def @disabled_widgets end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
7 8 9 |
# File 'lib/ahoy_captain/configuration.rb', line 7 def event @event end |
#filters ⇒ Object (readonly)
Returns the value of attribute filters.
7 8 9 |
# File 'lib/ahoy_captain/configuration.rb', line 7 def filters @filters end |
#funnels ⇒ Object (readonly)
Returns the value of attribute funnels.
7 8 9 |
# File 'lib/ahoy_captain/configuration.rb', line 7 def funnels @funnels end |
#goals ⇒ Object (readonly)
Returns the value of attribute goals.
7 8 9 |
# File 'lib/ahoy_captain/configuration.rb', line 7 def goals @goals end |
#models ⇒ Object (readonly)
Returns the value of attribute models.
7 8 9 |
# File 'lib/ahoy_captain/configuration.rb', line 7 def models @models end |
#predicate_labels ⇒ Object (readonly)
Returns the value of attribute predicate_labels.
7 8 9 |
# File 'lib/ahoy_captain/configuration.rb', line 7 def predicate_labels @predicate_labels end |
#ranges ⇒ Object (readonly)
Returns the value of attribute ranges.
7 8 9 |
# File 'lib/ahoy_captain/configuration.rb', line 7 def ranges @ranges end |
#realtime_interval ⇒ Object
Returns the value of attribute realtime_interval.
6 7 8 |
# File 'lib/ahoy_captain/configuration.rb', line 6 def realtime_interval @realtime_interval end |
#theme ⇒ Object
Returns the value of attribute theme.
6 7 8 |
# File 'lib/ahoy_captain/configuration.rb', line 6 def theme @theme end |
#view_name ⇒ Object
Returns the value of attribute view_name.
6 7 8 |
# File 'lib/ahoy_captain/configuration.rb', line 6 def view_name @view_name end |