Class: Pushpop::Keen
- Inherits:
-
Step
- Object
- Step
- Pushpop::Keen
- Defined in:
- lib/pushpop-keen.rb,
lib/pushpop-keen/version.rb
Constant Summary collapse
- PLUGIN_NAME =
'keen'- VERSION =
'0.3'
Instance Attribute Summary collapse
-
#_analyses ⇒ Object
Returns the value of attribute _analyses.
-
#_analysis_type ⇒ Object
Returns the value of attribute _analysis_type.
-
#_event_collection ⇒ Object
Returns the value of attribute _event_collection.
-
#_filters ⇒ Object
Returns the value of attribute _filters.
-
#_group_by ⇒ Object
Returns the value of attribute _group_by.
-
#_interval ⇒ Object
Returns the value of attribute _interval.
-
#_max_age ⇒ Object
Returns the value of attribute _max_age.
-
#_steps ⇒ Object
Returns the value of attribute _steps.
-
#_target_property ⇒ Object
Returns the value of attribute _target_property.
-
#_timeframe ⇒ Object
Returns the value of attribute _timeframe.
Instance Method Summary collapse
- #analyses(analyses) ⇒ Object
- #analysis_type(analysis_type) ⇒ Object
- #configure(last_response = nil, step_responses = nil) ⇒ Object
- #event_collection(event_collection) ⇒ Object
- #filters(filters) ⇒ Object
- #group_by(group_by) ⇒ Object
- #interval(interval) ⇒ Object
- #max_age(max_age) ⇒ Object
- #record(name, properties) ⇒ Object
- #run(last_response = nil, step_responses = nil) ⇒ Object
- #steps(steps) ⇒ Object
- #target_property(target_property) ⇒ Object
- #timeframe(timeframe) ⇒ Object
- #to_analysis_options ⇒ Object
Instance Attribute Details
#_analyses ⇒ Object
Returns the value of attribute _analyses.
20 21 22 |
# File 'lib/pushpop-keen.rb', line 20 def _analyses @_analyses end |
#_analysis_type ⇒ Object
Returns the value of attribute _analysis_type.
13 14 15 |
# File 'lib/pushpop-keen.rb', line 13 def _analysis_type @_analysis_type end |
#_event_collection ⇒ Object
Returns the value of attribute _event_collection.
12 13 14 |
# File 'lib/pushpop-keen.rb', line 12 def _event_collection @_event_collection end |
#_filters ⇒ Object
Returns the value of attribute _filters.
18 19 20 |
# File 'lib/pushpop-keen.rb', line 18 def _filters @_filters end |
#_group_by ⇒ Object
Returns the value of attribute _group_by.
16 17 18 |
# File 'lib/pushpop-keen.rb', line 16 def _group_by @_group_by end |
#_interval ⇒ Object
Returns the value of attribute _interval.
17 18 19 |
# File 'lib/pushpop-keen.rb', line 17 def _interval @_interval end |
#_max_age ⇒ Object
Returns the value of attribute _max_age.
21 22 23 |
# File 'lib/pushpop-keen.rb', line 21 def _max_age @_max_age end |
#_steps ⇒ Object
Returns the value of attribute _steps.
19 20 21 |
# File 'lib/pushpop-keen.rb', line 19 def _steps @_steps end |
#_target_property ⇒ Object
Returns the value of attribute _target_property.
15 16 17 |
# File 'lib/pushpop-keen.rb', line 15 def _target_property @_target_property end |
#_timeframe ⇒ Object
Returns the value of attribute _timeframe.
14 15 16 |
# File 'lib/pushpop-keen.rb', line 14 def _timeframe @_timeframe end |
Instance Method Details
#analyses(analyses) ⇒ Object
87 88 89 |
# File 'lib/pushpop-keen.rb', line 87 def analyses(analyses) self._analyses = analyses end |
#analysis_type(analysis_type) ⇒ Object
59 60 61 |
# File 'lib/pushpop-keen.rb', line 59 def analysis_type(analysis_type) self._analysis_type = analysis_type end |
#configure(last_response = nil, step_responses = nil) ⇒ Object
35 36 37 |
# File 'lib/pushpop-keen.rb', line 35 def configure(last_response=nil, step_responses=nil) self.instance_exec(last_response, step_responses, &block) end |
#event_collection(event_collection) ⇒ Object
55 56 57 |
# File 'lib/pushpop-keen.rb', line 55 def event_collection(event_collection) self._event_collection = event_collection end |
#filters(filters) ⇒ Object
79 80 81 |
# File 'lib/pushpop-keen.rb', line 79 def filters(filters) self._filters = filters end |
#group_by(group_by) ⇒ Object
71 72 73 |
# File 'lib/pushpop-keen.rb', line 71 def group_by(group_by) self._group_by = group_by end |
#interval(interval) ⇒ Object
75 76 77 |
# File 'lib/pushpop-keen.rb', line 75 def interval(interval) self._interval = interval end |
#max_age(max_age) ⇒ Object
91 92 93 |
# File 'lib/pushpop-keen.rb', line 91 def max_age(max_age) self._max_age = max_age end |
#record(name, properties) ⇒ Object
39 40 41 |
# File 'lib/pushpop-keen.rb', line 39 def record(name, properties) ::Keen.publish(name, properties) end |
#run(last_response = nil, step_responses = nil) ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/pushpop-keen.rb', line 23 def run(last_response=nil, step_responses=nil) ret = self.configure(last_response, step_responses) if self._analysis_type == 'funnel' ::Keen.funnel(self.) elsif !self._analysis_type.nil? ::Keen.send(self._analysis_type, self._event_collection, self.) else ret end end |
#steps(steps) ⇒ Object
83 84 85 |
# File 'lib/pushpop-keen.rb', line 83 def steps(steps) self._steps = steps end |
#target_property(target_property) ⇒ Object
67 68 69 |
# File 'lib/pushpop-keen.rb', line 67 def target_property(target_property) self._target_property = target_property end |
#timeframe(timeframe) ⇒ Object
63 64 65 |
# File 'lib/pushpop-keen.rb', line 63 def timeframe(timeframe) self._timeframe = timeframe end |
#to_analysis_options ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/pushpop-keen.rb', line 43 def { timeframe: self._timeframe, target_property: self._target_property, group_by: self._group_by, interval: self._interval, filters: self._filters, analyses: self._analyses, max_age: self._max_age, steps: self._steps }.delete_if { |_, v| v.nil? } end |