Module: Alchemrest::Transforms::Constrainable::InstanceMethods
- Defined in:
- lib/alchemrest/transforms/constrainable.rb
Instance Method Summary collapse
Instance Method Details
#where(constraint_or_description, &block) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/alchemrest/transforms/constrainable.rb', line 20 def where(constraint_or_description, &block) constraint = if block Constraint::Block.new(constraint_or_description, &block) elsif constraint_or_description.is_a?(Constraint) constraint_or_description else raise ArgumentError, "Must provide an instance of Alchemrest::Transform::Constraint" end with(constraints: [*constraints, constraint]) end |