Class: DrgDSL::Ast::Variable
Overview
“PDX”, “AGEYEARS”, …
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #hash ⇒ Object
-
#initialize(name) ⇒ Variable
constructor
A new instance of Variable.
- #to_hash ⇒ Object
Methods included from Node
#==, #accept, included, #mdc_equality?, node_classes, #pretty_print, #sep_equality?, type, #type
Constructor Details
#initialize(name) ⇒ Variable
Returns a new instance of Variable.
427 428 429 |
# File 'lib/drgdsl/ast.rb', line 427 def initialize(name) @name = name.to_s.strip end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
425 426 427 |
# File 'lib/drgdsl/ast.rb', line 425 def name @name end |
Instance Method Details
#hash ⇒ Object
435 436 437 |
# File 'lib/drgdsl/ast.rb', line 435 def hash @hash ||= [type, name].hash end |
#to_hash ⇒ Object
431 432 433 |
# File 'lib/drgdsl/ast.rb', line 431 def to_hash { name: name } end |