Class: Sablon::Processor::Document::InlineParagraphBlock

Inherits:
Block
  • Object
show all
Defined in:
lib/sablon/processor/document/blocks.rb

Instance Attribute Summary

Attributes inherited from Block

#end_field, #start_field

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Block

#body, enclosed_by, #initialize, parent, parent_selector, #process, #replace

Constructor Details

This class inherits a constructor from Sablon::Processor::Document::Block

Class Method Details

.encloses?(start_field, end_field) ⇒ Boolean

Returns:

  • (Boolean)


114
115
116
# File 'lib/sablon/processor/document/blocks.rb', line 114

def self.encloses?(start_field, end_field)
  super && parent(start_field) == parent(end_field)
end

Instance Method Details

#end_nodeObject



128
129
130
# File 'lib/sablon/processor/document/blocks.rb', line 128

def end_node
  @end_node ||= end_field.start_node
end

#remove_control_elementsObject



118
119
120
121
122
# File 'lib/sablon/processor/document/blocks.rb', line 118

def remove_control_elements
  body.each(&:remove)
  start_field.remove
  end_field.remove
end

#start_nodeObject



124
125
126
# File 'lib/sablon/processor/document/blocks.rb', line 124

def start_node
  @start_node ||= start_field.end_node
end