Class: FactoryBotProfile::Stack
- Inherits:
-
Object
- Object
- FactoryBotProfile::Stack
- Defined in:
- lib/factory_bot_profile/stack.rb
Instance Method Summary collapse
- #<<(name) ⇒ Object
-
#initialize ⇒ Stack
constructor
A new instance of Stack.
- #pop ⇒ Object
Constructor Details
#initialize ⇒ Stack
Returns a new instance of Stack.
5 6 7 |
# File 'lib/factory_bot_profile/stack.rb', line 5 def initialize @stack = [] end |
Instance Method Details
#<<(name) ⇒ Object
9 10 11 |
# File 'lib/factory_bot_profile/stack.rb', line 9 def <<(name) @stack << Frame.new(name) end |
#pop ⇒ Object
13 14 15 16 17 18 |
# File 'lib/factory_bot_profile/stack.rb', line 13 def pop @stack.pop.tap do |frame| frame.finish! @stack.last.observe_child(frame) unless @stack.empty? end end |