Class: MasterView::TemplateProcessing::DirectiveCallStack
- Inherits:
-
Object
- Object
- MasterView::TemplateProcessing::DirectiveCallStack
- Defined in:
- lib/masterview/parser.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#directives_to_call ⇒ Object
readonly
Returns the value of attribute directives_to_call.
Instance Method Summary collapse
- #<<(directive_calls) ⇒ Object
-
#initialize ⇒ DirectiveCallStack
constructor
A new instance of DirectiveCallStack.
- #render ⇒ Object
Constructor Details
#initialize ⇒ DirectiveCallStack
Returns a new instance of DirectiveCallStack.
67 68 69 |
# File 'lib/masterview/parser.rb', line 67 def initialize @directives_to_call = [] end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
65 66 67 |
# File 'lib/masterview/parser.rb', line 65 def context @context end |
#directives_to_call ⇒ Object (readonly)
Returns the value of attribute directives_to_call.
64 65 66 |
# File 'lib/masterview/parser.rb', line 64 def directives_to_call @directives_to_call end |
Instance Method Details
#<<(directive_calls) ⇒ Object
71 72 73 74 75 76 77 78 79 |
# File 'lib/masterview/parser.rb', line 71 def <<(directive_calls) if directive_calls.is_a? DirectiveCallStack @directives_to_call << directive_calls.directives_to_call else @directives_to_call << directive_calls end @directives_to_call.flatten! self end |
#render ⇒ Object
81 82 83 84 85 |
# File 'lib/masterview/parser.rb', line 81 def render return [] if @directives_to_call.empty? directive_proc = @directives_to_call.shift directive_proc.call(self) end |