Class: DrgDSL::Ast::Variable

Inherits:
Object
  • Object
show all
Includes:
Node
Defined in:
lib/drgdsl/ast.rb

Overview

“PDX”, “AGEYEARS”, …

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



425
426
427
# File 'lib/drgdsl/ast.rb', line 425

def name
  @name
end

Instance Method Details

#hashObject



435
436
437
# File 'lib/drgdsl/ast.rb', line 435

def hash
  @hash ||= [type, name].hash
end

#to_hashObject



431
432
433
# File 'lib/drgdsl/ast.rb', line 431

def to_hash
  { name: name }
end