Class: Scribble::Block
- Includes:
- Support::Context
- Defined in:
- lib/scribble/block.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Support::Context
#converter, #evaluate, #format, included, #registers, #render, #render_format, #render_without_conversion, #require_conversion?, #resolve_variable, #set_variable, #template, #variables
Methods inherited from Method
eql?, implement, #initialize, insert, max_arity, min_arity, register, setup, split?
Constructor Details
This class inherits a constructor from Scribble::Method
Class Method Details
.block? ⇒ Boolean
5 6 7 |
# File 'lib/scribble/block.rb', line 5 def self.block? true end |
Instance Method Details
#nodes ⇒ Object
9 10 11 |
# File 'lib/scribble/block.rb', line 9 def nodes @nodes || @call.nodes end |
#split_nodes ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/scribble/block.rb', line 13 def split_nodes nodes.take_while.with_index do |node, index| if node.split? @nodes = nodes.drop index + 1 node.evaluate self, allow_split: true, allow_block: false false else true end end end |