lib/pushpop-keen.rb in pushpop-keen-0.1.1 vs lib/pushpop-keen.rb in pushpop-keen-0.2

- old
+ new

@@ -18,15 +18,26 @@ attr_accessor :_filters attr_accessor :_steps attr_accessor :_analyses def run(last_response=nil, step_responses=nil) - self.configure(last_response, step_responses) - ::Keen.send(self._analysis_type, self._event_collection, self.to_analysis_options) + ret = self.configure(last_response, step_responses) + + if self._analysis_type == 'funnel' + ::Keen.funnel(self.to_analysis_options) + elsif !self._analysis_type.nil? + ::Keen.send(self._analysis_type, self._event_collection, self.to_analysis_options) + else + ret + end end def configure(last_response=nil, step_responses=nil) self.instance_exec(last_response, step_responses, &block) + end + + def record(name, properties) + ::Keen.publish(name, properties) end def to_analysis_options { timeframe: self._timeframe, target_property: self._target_property,