Class: RBlade::StackManager::Stack

Inherits:
Object
  • Object
show all
Defined in:
lib/rblade/helpers/stack_manager.rb

Instance Method Summary collapse

Constructor Details

#initializeStack

Returns a new instance of Stack.



36
37
38
39
# File 'lib/rblade/helpers/stack_manager.rb', line 36

def initialize
  @prepends = ""
  @stack = ""
end

Instance Method Details

#prepend(code) ⇒ Object



53
54
55
# File 'lib/rblade/helpers/stack_manager.rb', line 53

def prepend code
  @prepends << code
end

#push(code) ⇒ Object



49
50
51
# File 'lib/rblade/helpers/stack_manager.rb', line 49

def push code
  @stack << code
end

#set_before_stack(before_stack) ⇒ Object



41
42
43
# File 'lib/rblade/helpers/stack_manager.rb', line 41

def set_before_stack before_stack
  @before_stack = before_stack
end

#to_sObject



45
46
47
# File 'lib/rblade/helpers/stack_manager.rb', line 45

def to_s
  "#{@before_stack}#{@prepends}#{@stack}"
end