Class: NicePartials::Partial::Stack
- Inherits:
-
Object
- Object
- NicePartials::Partial::Stack
- Defined in:
- lib/nice_partials/partial/stack.rb
Instance Method Summary collapse
-
#initialize ⇒ Stack
constructor
A new instance of Stack.
- #locate_previous ⇒ Object
- #partial ⇒ Object
- #reset_locator ⇒ Object
Constructor Details
#initialize ⇒ Stack
Returns a new instance of Stack.
2 3 4 5 |
# File 'lib/nice_partials/partial/stack.rb', line 2 def initialize @partials = [] reset_locator end |
Instance Method Details
#locate_previous ⇒ Object
12 13 14 |
# File 'lib/nice_partials/partial/stack.rb', line 12 def locate_previous @locator = :second end |
#partial ⇒ Object
8 9 10 |
# File 'lib/nice_partials/partial/stack.rb', line 8 def partial @partials.public_send @locator end |
#reset_locator ⇒ Object
16 17 18 |
# File 'lib/nice_partials/partial/stack.rb', line 16 def reset_locator @locator = :first end |