Class: Lookout::Configuration
- Inherits:
-
Object
- Object
- Lookout::Configuration
- Defined in:
- lib/lookout/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.
-
#return_copy ⇒ Object
Returns the value of attribute return_copy.
-
#return_path ⇒ Object
Returns the value of attribute return_path.
-
#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 39 40 41 42 |
# File 'lib/lookout/configuration.rb', line 8 def initialize @goals = GoalCollection.new @funnels = FunnelCollection.new @theme = "dark" @return_path = "/" @return_copy = "← Back" @ranges = ::Lookout::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" # Dynamically generate SQL based on database adapter table_name = @models.event.parameterize.tableize option.url_column = DatabaseAdapter.build_url_column(table_name) option.url_exists = DatabaseAdapter.build_url_exists(table_name) 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/lookout/configuration.rb', line 7 def cache @cache end |
#disabled_widgets ⇒ Object
Returns the value of attribute disabled_widgets.
6 7 8 |
# File 'lib/lookout/configuration.rb', line 6 def @disabled_widgets end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
7 8 9 |
# File 'lib/lookout/configuration.rb', line 7 def event @event end |
#filters ⇒ Object (readonly)
Returns the value of attribute filters.
7 8 9 |
# File 'lib/lookout/configuration.rb', line 7 def filters @filters end |
#funnels ⇒ Object (readonly)
Returns the value of attribute funnels.
7 8 9 |
# File 'lib/lookout/configuration.rb', line 7 def funnels @funnels end |
#goals ⇒ Object (readonly)
Returns the value of attribute goals.
7 8 9 |
# File 'lib/lookout/configuration.rb', line 7 def goals @goals end |
#models ⇒ Object (readonly)
Returns the value of attribute models.
7 8 9 |
# File 'lib/lookout/configuration.rb', line 7 def models @models end |
#predicate_labels ⇒ Object (readonly)
Returns the value of attribute predicate_labels.
7 8 9 |
# File 'lib/lookout/configuration.rb', line 7 def predicate_labels @predicate_labels end |
#ranges ⇒ Object (readonly)
Returns the value of attribute ranges.
7 8 9 |
# File 'lib/lookout/configuration.rb', line 7 def ranges @ranges end |
#realtime_interval ⇒ Object
Returns the value of attribute realtime_interval.
6 7 8 |
# File 'lib/lookout/configuration.rb', line 6 def realtime_interval @realtime_interval end |
#return_copy ⇒ Object
Returns the value of attribute return_copy.
6 7 8 |
# File 'lib/lookout/configuration.rb', line 6 def return_copy @return_copy end |
#return_path ⇒ Object
Returns the value of attribute return_path.
6 7 8 |
# File 'lib/lookout/configuration.rb', line 6 def return_path @return_path end |
#theme ⇒ Object
Returns the value of attribute theme.
6 7 8 |
# File 'lib/lookout/configuration.rb', line 6 def theme @theme end |
#view_name ⇒ Object
Returns the value of attribute view_name.
6 7 8 |
# File 'lib/lookout/configuration.rb', line 6 def view_name @view_name end |