Class: RBlade::StackManager::Stack
- Inherits:
-
Object
- Object
- RBlade::StackManager::Stack
- Defined in:
- lib/rblade/helpers/stack_manager.rb
Instance Method Summary collapse
-
#initialize ⇒ Stack
constructor
A new instance of Stack.
- #prepend(code) ⇒ Object
- #push(code) ⇒ Object
- #set_before_stack(before_stack) ⇒ Object
- #to_s ⇒ Object
- #to_str ⇒ Object
Constructor Details
#initialize ⇒ Stack
Returns a new instance of Stack.
38 39 40 41 |
# File 'lib/rblade/helpers/stack_manager.rb', line 38 def initialize @prepends = +"" @stack = +"" end |
Instance Method Details
#prepend(code) ⇒ Object
59 60 61 |
# File 'lib/rblade/helpers/stack_manager.rb', line 59 def prepend(code) @prepends << code end |
#push(code) ⇒ Object
55 56 57 |
# File 'lib/rblade/helpers/stack_manager.rb', line 55 def push(code) @stack << code end |
#set_before_stack(before_stack) ⇒ Object
43 44 45 |
# File 'lib/rblade/helpers/stack_manager.rb', line 43 def set_before_stack(before_stack) @before_stack = before_stack end |
#to_s ⇒ Object
47 48 49 |
# File 'lib/rblade/helpers/stack_manager.rb', line 47 def to_s "#{@before_stack}#{@prepends}#{@stack}" end |
#to_str ⇒ Object
51 52 53 |
# File 'lib/rblade/helpers/stack_manager.rb', line 51 def to_str to_s end |