Class: RBelly::Nodes::VarDeclNode
- Defined in:
- lib/rbelly/nodes/var_decl_node.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from Node
#comments, #filename, #line, #value
Instance Method Summary collapse
- #constant? ⇒ Boolean
-
#initialize(name, value, constant = false) ⇒ VarDeclNode
constructor
A new instance of VarDeclNode.
- #variable? ⇒ Boolean
Methods inherited from Node
#==, #===, #each, #pointcut, #to_dots, #to_ecma, #to_real_sexp, #to_sexp
Methods included from Visitable
Constructor Details
#initialize(name, value, constant = false) ⇒ VarDeclNode
Returns a new instance of VarDeclNode.
5 6 7 8 9 |
# File 'lib/rbelly/nodes/var_decl_node.rb', line 5 def initialize(name, value, constant = false) super(value) @name = name @constant = constant end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/rbelly/nodes/var_decl_node.rb', line 4 def name @name end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/rbelly/nodes/var_decl_node.rb', line 4 def type @type end |
Instance Method Details
#constant? ⇒ Boolean
11 |
# File 'lib/rbelly/nodes/var_decl_node.rb', line 11 def constant?; @constant; end |
#variable? ⇒ Boolean
12 |
# File 'lib/rbelly/nodes/var_decl_node.rb', line 12 def variable?; !@constant; end |