Class: Stannum::Constraints::Parameters::ExtraArguments

Inherits:
Tuples::ExtraItems show all
Defined in:
lib/stannum/constraints/parameters/extra_arguments.rb

Overview

Validates that the arguments passed to a method have no extra items.

Examples:

constraint = Stannum::Constraints::Parameters::ExtraArguments.new(3)

constraint.matches?([])           #=> true
constraint.matches?([1])          #=> true
constraint.matches?([1, 2, 3])    #=> true
constraint.matches?([1, 2, 3, 4]) #=> false

Constant Summary collapse

NEGATED_TYPE =

The :type of the error generated for a matching object.

'stannum.constraints.parameters.no_extra_arguments'
TYPE =

The :type of the error generated for a non-matching object.

'stannum.constraints.parameters.extra_arguments'

Instance Attribute Summary

Attributes inherited from Base

#options

Method Summary

Methods inherited from Tuples::ExtraItems

#does_not_match?, #errors_for, #expected_count, #initialize, #matches?

Methods inherited from Base

#==, #clone, #does_not_match?, #dup, #errors_for, #initialize, #match, #matches?, #message, #negated_errors_for, #negated_match, #negated_message, #negated_type, #type, #with_options

Constructor Details

This class inherits a constructor from Stannum::Constraints::Tuples::ExtraItems