Class: Ruty::Datastructure::TextNode

Inherits:
Node
  • Object
show all
Defined in:
lib/ruty/datastructure.rb

Overview

a node that stores text data

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ TextNode

Returns a new instance of TextNode.



50
51
52
# File 'lib/ruty/datastructure.rb', line 50

def initialize text
  @text = text
end

Instance Method Details

#render_node(context, stream) ⇒ Object



54
55
56
57
# File 'lib/ruty/datastructure.rb', line 54

def render_node context, stream
  stream << @text
  nil
end