module Lab42::BasicConstraints

Constants

ConstraintError
Constraints
MissingDefaultError
VERSION

Public Instance Methods

all_constraints() click to toggle source
# File lib/lab42/basic_constraints.rb, line 40
def all_constraints
  Constraints.keys
end
from_symbol(name, *args, **kwds, &blk) click to toggle source
# File lib/lab42/basic_constraints.rb, line 44
def from_symbol name, *args, **kwds, &blk
  cons = Constraints.fetch(name, &blk)
  case cons
  # when Constraint
  #   cons
  when Proc
    Constraint.new(name, &cons)
  when Symbol
    Implementation.send(cons, *args, **kwds)
  when Class
    Constraint.new(name){ cons === _1 }
  end
end
method_missing(name, *args, **kwds) click to toggle source
Calls superclass method
# File lib/lab42/basic_constraints.rb, line 58
def method_missing(name, *args, **kwds)
  from_symbol(name, *args, **kwds) {super}
end