Class: Juli::Absyn::StrNode
Overview
StrNode adds ‘concat’ string manupilation method
StrNode is also an element of ListItem
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
-
#str ⇒ Object
Returns the value of attribute str.
Attributes inherited from Node
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
- #concat(str) ⇒ Object
-
#initialize(str = '', level = 0) ⇒ StrNode
constructor
A new instance of StrNode.
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
#level ⇒ Object
Returns the value of attribute level.
17 18 19 |
# File 'lib/juli/absyn.rb', line 17 def level @level end |
#str ⇒ Object
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 |