Class: DrgDSL::Ast::SrglrbTableCondition

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

Overview

INFO: srg (prozedur) l (links) r (rechts) b(beidseitig)

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(variable:, condition:) ⇒ SrglrbTableCondition

Returns a new instance of SrglrbTableCondition.



350
351
352
353
# File 'lib/drgdsl/ast.rb', line 350

def initialize(variable:, condition:)
  @variable = variable
  @condition = condition
end

Instance Attribute Details

#conditionObject (readonly)

Returns the value of attribute condition.



348
349
350
# File 'lib/drgdsl/ast.rb', line 348

def condition
  @condition
end

#variableObject (readonly)

Returns the value of attribute variable.



348
349
350
# File 'lib/drgdsl/ast.rb', line 348

def variable
  @variable
end

Instance Method Details

#hashObject



364
365
366
# File 'lib/drgdsl/ast.rb', line 364

def hash
  @hash ||= [type, variable, condition].hash
end

#to_hashObject



355
356
357
358
359
360
361
362
# File 'lib/drgdsl/ast.rb', line 355

def to_hash
  {
    srglrb_table_condition: {
      var: variable.to_hash,
      condition: condition.to_hash
    }
  }
end