Class: Rox::Core::Analytics::TestQueue

Inherits:
Object
  • Object
show all
Defined in:
lib/rox/core/analytics/test_queue.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTestQueue

Returns a new instance of TestQueue.



7
8
9
# File 'lib/rox/core/analytics/test_queue.rb', line 7

def initialize
  reset!
end

Instance Attribute Details

#messagesObject (readonly)

Returns the value of attribute messages.



5
6
7
# File 'lib/rox/core/analytics/test_queue.rb', line 5

def messages
  @messages
end

Instance Method Details

#<<(message) ⇒ Object



19
20
21
22
# File 'lib/rox/core/analytics/test_queue.rb', line 19

def <<(message)
  all << message
  send(message[:type]) << message
end

#[](key) ⇒ Object



11
12
13
# File 'lib/rox/core/analytics/test_queue.rb', line 11

def [](key)
  all[key]
end

#aliasObject



24
25
26
# File 'lib/rox/core/analytics/test_queue.rb', line 24

def alias
  messages[:alias] ||= []
end

#allObject



28
29
30
# File 'lib/rox/core/analytics/test_queue.rb', line 28

def all
  messages[:all] ||= []
end

#countObject



15
16
17
# File 'lib/rox/core/analytics/test_queue.rb', line 15

def count
  all.count
end

#groupObject



32
33
34
# File 'lib/rox/core/analytics/test_queue.rb', line 32

def group
  messages[:group] ||= []
end

#identifyObject



36
37
38
# File 'lib/rox/core/analytics/test_queue.rb', line 36

def identify
  messages[:identify] ||= []
end

#pageObject



40
41
42
# File 'lib/rox/core/analytics/test_queue.rb', line 40

def page
  messages[:page] ||= []
end

#reset!Object



52
53
54
# File 'lib/rox/core/analytics/test_queue.rb', line 52

def reset!
  @messages = {}
end

#screenObject



44
45
46
# File 'lib/rox/core/analytics/test_queue.rb', line 44

def screen
  messages[:screen] ||= []
end

#trackObject



48
49
50
# File 'lib/rox/core/analytics/test_queue.rb', line 48

def track
  messages[:track] ||= []
end