Module: Qrb::Syntax::ConstraintDef

Defined in:
lib/qrb/syntax/constraint_def.rb

Instance Method Summary collapse

Instance Method Details

#compile(factory) ⇒ Object



5
6
7
# File 'lib/qrb/syntax/constraint_def.rb', line 5

def compile(factory)
  constraints.compile(var_name.to_s)
end

#to_astObject



9
10
11
12
13
# File 'lib/qrb/syntax/constraint_def.rb', line 9

def to_ast
  ast = constraints.to_ast(var_name.to_s)
  ast = [ast] if ast.first.is_a?(Symbol)
  ast
end