Class: June::Analytics::TestQueue

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeTestQueue

Returns a new instance of TestQueue.



6
7
8
# File 'lib/june/analytics/test_queue.rb', line 6

def initialize
  reset!
end

Instance Attribute Details

#messagesObject (readonly)

Returns the value of attribute messages.



4
5
6
# File 'lib/june/analytics/test_queue.rb', line 4

def messages
  @messages
end

Instance Method Details

#<<(message) ⇒ Object



18
19
20
21
# File 'lib/june/analytics/test_queue.rb', line 18

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

#[](key) ⇒ Object



10
11
12
# File 'lib/june/analytics/test_queue.rb', line 10

def [](key)
  all[key]
end

#aliasObject



23
24
25
# File 'lib/june/analytics/test_queue.rb', line 23

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

#allObject



27
28
29
# File 'lib/june/analytics/test_queue.rb', line 27

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

#countObject



14
15
16
# File 'lib/june/analytics/test_queue.rb', line 14

def count
  all.count
end

#groupObject



31
32
33
# File 'lib/june/analytics/test_queue.rb', line 31

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

#identifyObject



35
36
37
# File 'lib/june/analytics/test_queue.rb', line 35

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

#pageObject



39
40
41
# File 'lib/june/analytics/test_queue.rb', line 39

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

#reset!Object



51
52
53
# File 'lib/june/analytics/test_queue.rb', line 51

def reset!
  @messages = {}
end

#screenObject



43
44
45
# File 'lib/june/analytics/test_queue.rb', line 43

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

#trackObject



47
48
49
# File 'lib/june/analytics/test_queue.rb', line 47

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