Class: Totango::Tracker

Inherits:
Object
  • Object
show all
Defined in:
lib/totango/tracker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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/totango/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

#actionObject (readonly)

Returns the value of attribute action.



20
21
22
# File 'lib/totango/tracker.rb', line 20

def action
  @action
end

#optsObject (readonly)

Returns the value of attribute opts.



20
21
22
# File 'lib/totango/tracker.rb', line 20

def opts
  @opts
end