Class: CheckNode

Inherits:
Node
  • Object
show all
Defined in:
lib/code_generator.rb

Instance Method Summary collapse

Methods inherited from Node

#column

Constructor Details

#initialize(val) ⇒ CheckNode

Returns a new instance of CheckNode.



61
# File 'lib/code_generator.rb', line 61

def initialize val; super(val); end

Instance Method Details

#genObject



63
64
65
66
67
68
69
70
71
# File 'lib/code_generator.rb', line 63

def gen
  column = @value.column
  val = @value.gen
  if val
    "validate { errors.add(:#{column}, \"Expected TODO\") unless #{val} }"
  else
    "validate { true }"
  end
end