This release marks the gem to be stable enough.
Note
Nothing notable was changed in the code since the last version.
- Added a section about overriding the defaults.
- Added a section about testing.
- Improved extendability: one may override
Magic::Decoratable#decorator_base
to be used for lookups. Magic::Decoratable.classes
for all the decoratables.
- Failures on double decoration attempts.
- For almost any method called on a decorated object, both its result and
yield
ed arguments get decorated. Some methods aren’t meant to be decorated though:deconstruct
&deconstruct_keys
for pattern matching,- converting methods: those starting with
to_
, - system methods: those starting with
_
.
Magic::Decorator::Base.undecorated
to exclude methods from being decorated automagically.
EnumerableDecorator
to decorateEnumerable
s.- enables splat operator:
*decorated
, - enables double-splat operator:
**decorated
, - enumerating methods yield decorated items.
- enables splat operator:
Magic::Decorator::Base
— a basic decorator class.Magic::Decoratable
to be included in decoratable classes.#decorate
,#decorate!
,#decorated
,#decorated?
.