Class: FactoryBotProfile::Subscriber

Inherits:
Object
  • Object
show all
Defined in:
lib/factory_bot_profile/subscriber.rb

Instance Method Summary collapse

Constructor Details

#initialize(stats) ⇒ Subscriber

Returns a new instance of Subscriber.



5
6
7
8
# File 'lib/factory_bot_profile/subscriber.rb', line 5

def initialize(stats)
  @stack = Stack.new
  @stats = stats
end

Instance Method Details

#finishObject



14
15
16
# File 'lib/factory_bot_profile/subscriber.rb', line 14

def finish(*)
  @stats.collect(@stack.pop)
end

#start(_, _, payload) ⇒ Object



10
11
12
# File 'lib/factory_bot_profile/subscriber.rb', line 10

def start(_, _, payload)
  @stack << payload[:name]
end