Class: Constraint::CArray

Inherits:
Shell
  • Object
show all
Defined in:
lib/constraint.rb

Overview

This is a simple test wrapper class for Array. This currently overwrites only a few methods so that most of the time the return value if filtered. As this often is the array itself, this isn’t very efficient.

Instance Attribute Summary

Attributes inherited from Shell

#constrained_value

Attributes included from Helper

#constraints, #descriptions

Instance Method Summary collapse

Methods inherited from Shell

#check_constraints, #clone, #dup, inherited, #initialize, #method_missing, #respond_to?, with_all_arguments_constrained, with_arguments_constrained, #with_constraints, without_constraints

Methods included from Helper

#and_constraint, #handle_constraint_violation, #log_constraint_exception, #or_constraint

Constructor Details

This class inherits a constructor from Constraint::Shell

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Constraint::Shell

Instance Method Details

#new_constrainedObject



342
343
344
# File 'lib/constraint.rb', line 342

def new_constrained
    []
end

#process_constrained_valueObject



346
347
348
# File 'lib/constraint.rb', line 346

def process_constrained_value
    @constrained_value.collect! {|e| yield e}
end