Class: Alchemrest::Transforms::ConstraintBuilder::ForNumber

Inherits:
Alchemrest::Transforms::ConstraintBuilder show all
Defined in:
lib/alchemrest/transforms/constraint_builder/for_number.rb

Constant Summary collapse

CONSTRAINT_METHODS =
%i(greater_than less_than greater_than_or_eq less_than_or_eq positive non_negative integer).freeze

Instance Method Summary collapse

Instance Method Details

#greater_thanObject



9
# File 'lib/alchemrest/transforms/constraint_builder/for_number.rb', line 9

def greater_than(...) = apply_constraint(Constraint::GreaterThan.new(...))

#greater_than_or_eqObject



13
# File 'lib/alchemrest/transforms/constraint_builder/for_number.rb', line 13

def greater_than_or_eq(...) = apply_constraint(Constraint::GreaterThanOrEq.new(...))

#integerObject



21
# File 'lib/alchemrest/transforms/constraint_builder/for_number.rb', line 21

def integer = apply_constraint(Constraint::IsInstanceOf.new(Integer))

#less_thanObject



11
# File 'lib/alchemrest/transforms/constraint_builder/for_number.rb', line 11

def less_than(...) = apply_constraint(Constraint::LessThan.new(...))

#less_than_or_eqObject



15
# File 'lib/alchemrest/transforms/constraint_builder/for_number.rb', line 15

def less_than_or_eq(...) = apply_constraint(Constraint::LessThanOrEq.new(...))

#non_negativeObject



19
# File 'lib/alchemrest/transforms/constraint_builder/for_number.rb', line 19

def non_negative = apply_constraint(Constraint::GreaterThanOrEq.new(0))

#positiveObject



17
# File 'lib/alchemrest/transforms/constraint_builder/for_number.rb', line 17

def positive = apply_constraint(Constraint::GreaterThan.new(0))