Class: Polites::Block::CodeBlock

Inherits:
Polites::Block show all
Defined in:
lib/polites/block/code_block.rb

Instance Attribute Summary collapse

Attributes inherited from Node

#children

Instance Method Summary collapse

Methods inherited from Polites::Block

build

Methods inherited from Node

#text

Constructor Details

#initialize(children, syntax) ⇒ CodeBlock

Returns a new instance of CodeBlock.



9
10
11
12
# File 'lib/polites/block/code_block.rb', line 9

def initialize(children, syntax)
  @syntax = syntax
  super(children)
end

Instance Attribute Details

#syntaxObject (readonly)

Returns the value of attribute syntax.



7
8
9
# File 'lib/polites/block/code_block.rb', line 7

def syntax
  @syntax
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/polites/block/code_block.rb', line 14

def eql?(other)
  super && syntax == other.syntax
end