Class: SaasPulse::Tracker
- Inherits:
-
Object
- Object
- SaasPulse::Tracker
- Defined in:
- lib/saas_pulse/tracker.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
Instance Method Summary collapse
-
#initialize(action, *opts) ⇒ Tracker
constructor
A new instance of Tracker.
Constructor Details
#initialize(action, *opts) ⇒ Tracker
Returns a new instance of Tracker.
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/saas_pulse/tracker.rb', line 3 def initialize(action, *opts) @action = action activity = opts.shift @opts = opts.empty? ? {} : opts.shift return unless activity case activity when String @opts[:activity] = activity when Hash @opts = activity else raise ArgumentError, "activity must be a String or Hash" end end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
20 21 22 |
# File 'lib/saas_pulse/tracker.rb', line 20 def action @action end |
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
20 21 22 |
# File 'lib/saas_pulse/tracker.rb', line 20 def opts @opts end |