T
Thomas
CHANGES:
- The evaluation order of constraints has changed from bottom-up to
top-down (which is more "natural")
- "Generators"
- Methods to collect valid results: #generate_constrained_value,
#next_constrained_value, #collect_constrained_values_until
- Changed the handling of constraint violations
- Some methods are directly delegated to the constrained value:
#inspect, #=~, #instance_eval, #===.
- Class method constraint_attr to define attributes that are properly
inherited
- Blocks for constraint and handler definitions now take the current
instance/object as the first argument, the value that has to be
checked/handled as the second
This is still not much more than a draft. But while implementing a few
examples for testing the "generators", I think this little thing became
more congruent. As some api changes where necessary, I uploaded this
version as v0.1 is obsolete.
This library provides a way to ensure that certain objects always
satisfy a specified set of constraints. An object that can be
constrained must be a child of Constraint::Shell, which acts as
a wrapper for the actual value. Constraints can added to subclasses and
its instances (per-object constraints). It is possible to define methods
that handle constraint violations and retrofit the object according to
its definition.
With some help from the developer, this library can also be used (to
some limited extent at least) to generate correct values and to find
solutions
fitting the set of constraints. There is no clever search routine
involved here. All possible values returned by the generator
are tested for their suitability until the generator says that there are
no more values.
The initial reason for writing this library was to create a restricted
collection type of class that may contain only values meeting some
criteria.
Project:: http://rubyforge.org/projects/constraint/
Download:: http://rubyforge.org/frs/?group_id=748
Support:: http://rubyforge.org/forum/?group_id=748
Cheers,
Thomas.
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
- The evaluation order of constraints has changed from bottom-up to
top-down (which is more "natural")
- "Generators"
- Methods to collect valid results: #generate_constrained_value,
#next_constrained_value, #collect_constrained_values_until
- Changed the handling of constraint violations
- Some methods are directly delegated to the constrained value:
#inspect, #=~, #instance_eval, #===.
- Class method constraint_attr to define attributes that are properly
inherited
- Blocks for constraint and handler definitions now take the current
instance/object as the first argument, the value that has to be
checked/handled as the second
This is still not much more than a draft. But while implementing a few
examples for testing the "generators", I think this little thing became
more congruent. As some api changes where necessary, I uploaded this
version as v0.1 is obsolete.
This library provides a way to ensure that certain objects always
satisfy a specified set of constraints. An object that can be
constrained must be a child of Constraint::Shell, which acts as
a wrapper for the actual value. Constraints can added to subclasses and
its instances (per-object constraints). It is possible to define methods
that handle constraint violations and retrofit the object according to
its definition.
With some help from the developer, this library can also be used (to
some limited extent at least) to generate correct values and to find
solutions
fitting the set of constraints. There is no clever search routine
involved here. All possible values returned by the generator
are tested for their suitability until the generator says that there are
no more values.
The initial reason for writing this library was to create a restricted
collection type of class that may contain only values meeting some
criteria.
Project:: http://rubyforge.org/projects/constraint/
Download:: http://rubyforge.org/frs/?group_id=748
Support:: http://rubyforge.org/forum/?group_id=748
Cheers,
Thomas.
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de