Class: FactoryBotProfile::Subscriber
- Inherits:
-
Object
- Object
- FactoryBotProfile::Subscriber
- Defined in:
- lib/factory_bot_profile/subscriber.rb
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(stats) ⇒ Subscriber
constructor
A new instance of Subscriber.
- #start(_, _, payload) ⇒ Object
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
#finish ⇒ Object
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 |