Module: Lab42::DataClass::Proxy::Constraints::Maker

Extended by:
Maker
Included in:
Maker
Defined in:
lib/lab42/data_class/proxy/constraints/maker.rb

Instance Method Summary collapse

Instance Method Details

#make_constraint(constraint, &blk) ⇒ Object

Raises:

  • (ArgumentError)


11
12
13
14
15
# File 'lib/lab42/data_class/proxy/constraints/maker.rb', line 11

def make_constraint(constraint, &blk)
  raise ArgumentError, "must not pass a callable #{constraint} and a block" if constraint && blk

  _make_constraint(constraint || blk)
end