Class: Juli::Absyn::StrNode

Inherits:
Node
  • Object
show all
Defined in:
lib/juli/absyn.rb

Overview

StrNode adds ‘concat’ string manupilation method

StrNode is also an element of ListItem

Instance Attribute Summary collapse

Attributes inherited from Node

#parent

Instance Method Summary collapse

Constructor Details

#initialize(str = '', level = 0) ⇒ StrNode

Returns a new instance of StrNode.



19
20
21
22
# File 'lib/juli/absyn.rb', line 19

def initialize(str = '', level = 0)
  @str    = str
  @level  = level
end

Instance Attribute Details

#levelObject

Returns the value of attribute level.



17
18
19
# File 'lib/juli/absyn.rb', line 17

def level
  @level
end

#strObject

Returns the value of attribute str.



17
18
19
# File 'lib/juli/absyn.rb', line 17

def str
  @str
end

Instance Method Details

#accept(visitor) ⇒ Object



28
29
30
# File 'lib/juli/absyn.rb', line 28

def accept(visitor)
  visitor.visit_str(self)
end

#concat(str) ⇒ Object



24
25
26
# File 'lib/juli/absyn.rb', line 24

def concat(str)
  @str += str
end