MooseX-CascadeClearing

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

META.yml
Makefile.PL
README
SIGNATURE
dist.ini
lib/MooseX/CascadeClearing.pm
t/00-compile.t
t/00-load.t
t/000-report-versions-tiny.t
t/01-meta-checks.t
t/02-simple-cascade.t
t/03-cascaded-cascades.t
t/04-cascade-wo-calling-clear.t
t/05-role.t
t/author-pod-spell.t
t/lib/CascadeFromRole.pm
t/lib/CascadeRole.pm
t/lib/DoubleCascade.pm
t/lib/SingleCascade.pm
t/release-consistent-version.t
t/release-eol.t
t/release-has-version.t
t/release-no-smart-comments.t

META.json  view on Meta::CPAN

         "version" : "0.05"
      },
      "MooseX::CascadeClearing::Role::Meta::Attribute" : {
         "file" : "lib/MooseX/CascadeClearing.pm",
         "version" : "0.05"
      }
   },
   "release_status" : "stable",
   "resources" : {
      "bugtracker" : {
         "web" : "https://github.com/RsrchBoy/moosex-cascadeclearing/issues"
      },
      "repository" : {
         "type" : "git",
         "url" : "git://github.com/RsrchBoy/moosex-cascadeclearing.git",
         "web" : "https://github.com/RsrchBoy/moosex-cascadeclearing"
      }
   },
   "version" : "0.05",
   "x_Dist_Zilla" : {
      "plugins" : [
         {
            "class" : "Dist::Zilla::Plugin::NextRelease",
            "name" : "@RSRCHBOY/Dist::Zilla::Plugin::NextRelease",
            "version" : "4.300021"
         },

META.yml  view on Meta::CPAN

  Carp: 0
  Moose: 0
  Moose::Exporter: 0
  Moose::Role: 0
  Moose::Util::MetaRole: 0
  namespace::autoclean: 0
  perl: 5.006
  strict: 0
  warnings: 0
resources:
  bugtracker: https://github.com/RsrchBoy/moosex-cascadeclearing/issues
  repository: git://github.com/RsrchBoy/moosex-cascadeclearing.git
version: 0.05
x_Dist_Zilla:
  plugins:
    -
      class: Dist::Zilla::Plugin::NextRelease
      name: '@RSRCHBOY/Dist::Zilla::Plugin::NextRelease'
      version: 4.300021
    -
      class: Dist::Zilla::Plugin::Git::Check
      name: '@RSRCHBOY/@Git/Check'

README  view on Meta::CPAN

        sub some_sub {
            # ...

            # clear master, sub[123] in one fell swoop
            $self->clear_master;

        }

DESCRIPTION
    MooseX::CascadeClearing does the necessary metaclass fiddling to allow
    an clearing one attribute to be cascaded through to other attributes as
    well, calling their clear accessors.

    The intended purpose of this is to assist in situations where the value
    of one attribute is derived from the value of another attribute -- say a
    situation where the secondary value is expensive to derive and is thus
    lazily built. A change to the primary attribute's value would invalidate
    the secondary value and as such the secondary should be cleared. While
    it could be argued that this is trivial to do manually for a few
    attributes, once we consider subclassing and adding in roles the ability
    to "auto-clear", as it were, is a valuable trait. (Sorry, couldn't
    resist.)

CAVEAT
    We don't yet trigger a cascade clear on a master attribute's value being
    set through a setter/accessor accessor. This will likely be available as
    an option in the not-too-distant-future.

ATTRIBUTE OPTIONS
    We install an attribute metaclass trait that provides two additional
    attribute options, as well as wraps the generated clearer method for a
    designated "master" attribute. By default, using this module causes this
    trait to be installed for all attributes in the package.

    is_clear_master => (0|1)
        If set to 1, we wrap this attribute's clearer with a sub that looks
        for other attributes to clear.

    clear_master => < attribute_name >
        Marks this attribute as one that should be cleared when the named
        attribute's clearer is called. Note that no checking is done to
        ensure that the named master is actually an attribute in the class.

SOURCE
    The development version is on github at
    <http://github.com/RsrchBoy/moosex-cascadeclearing> and may be cloned
    from <git://github.com/RsrchBoy/moosex-cascadeclearing.git>

BUGS
    Please report any bugs or feature requests on the bugtracker website
    https://github.com/RsrchBoy/moosex-cascadeclearing/issues

    When submitting a bug or request, please include a test-file or a patch
    to an existing test-file that illustrates the bug or desired feature.

AUTHOR
    Chris Weyl <cweyl@alumni.drew.edu>

COPYRIGHT AND LICENSE
    This software is Copyright (c) 2012 by Chris Weyl.

SIGNATURE  view on Meta::CPAN

SHA1 97d7c4d39db18f0b00a6690a0872319a9ced1dcf META.json
SHA1 637eeda3138ff0808410662681ecc51fc722d380 META.yml
SHA1 a471e00d12b0cd20c3223d3a896a3a6da3e59886 Makefile.PL
SHA1 98b3306b4554e57d1f055443e1f3c6b69be8b410 README
SHA1 3d310fcfa986c1cb70ea9c6c8caa6240d0c4c500 dist.ini
SHA1 b36d15007fa0d6f44782a443cfb38e8ce3048012 lib/MooseX/CascadeClearing.pm
SHA1 f115339474f18e8333aadaf2b9499af6763ac81b t/00-compile.t
SHA1 a321fe7d57632f940891d520ca04bbbf17293716 t/00-load.t
SHA1 524c9ffb2a8c9c26ace663bf696daf27a4626842 t/000-report-versions-tiny.t
SHA1 f41d44d1a3dab7e0588da31e1249f290bc8cda55 t/01-meta-checks.t
SHA1 73f1a06481e49319684edc7c206448bc126bd45e t/02-simple-cascade.t
SHA1 04a9d8266c783a68bbe2a0875ae3677f376d3b51 t/03-cascaded-cascades.t
SHA1 f58365135029d9e1eb51cc7219a310a3025e066b t/04-cascade-wo-calling-clear.t
SHA1 421f14a5bbb9d2cc641b3988957dfed5d9278cb1 t/05-role.t
SHA1 6cbb9bc6caf0d9dd127a583d59a4768e8caf3c99 t/author-pod-spell.t
SHA1 706d182e5e1f7fd4d9060311cadc4f7cd86a8bad t/lib/CascadeFromRole.pm
SHA1 d154d70dd0cb6d544da29059c054a7af1c10218f t/lib/CascadeRole.pm
SHA1 177fddd801c9a59d3fbe2ebb8a3f0c42e5d09563 t/lib/DoubleCascade.pm
SHA1 e96c0e68f5fa2f07d207cd165f8f54498fe72d32 t/lib/SingleCascade.pm
SHA1 9c3627ff37f4fd5bddc34bf46cf3359eaf76a060 t/release-consistent-version.t
SHA1 a032c41ef6887fab1b900669c2d304fab46680e2 t/release-eol.t
SHA1 aed3b4e41d91a53207aa2fe9d804394c47ca487a t/release-has-version.t
SHA1 52742c1f6afe174132d6a211b74b3df232c77bff t/release-no-smart-comments.t

lib/MooseX/CascadeClearing.pm  view on Meta::CPAN

        # ...

        # clear master, sub[123] in one fell swoop
        $self->clear_master;

    }

=head1 DESCRIPTION

MooseX::CascadeClearing does the necessary metaclass fiddling to allow an
clearing one attribute to be cascaded through to other attributes as well,
calling their clear accessors.

The intended purpose of this is to assist in situations where the value of one
attribute is derived from the value of another attribute -- say a situation
where the secondary value is expensive to derive and is thus lazily built.  A
change to the primary attribute's value would invalidate the secondary value
and as such the secondary should be cleared.  While it could be argued that
this is trivial to do manually for a few attributes, once we consider
subclassing and adding in roles the ability to "auto-clear", as it were, is
a valuable trait.  (Sorry, couldn't resist.)

=for Pod::Coverage init_meta

=head1 CAVEAT

We don't yet trigger a cascade clear on a master attribute's value being set
through a setter/accessor accessor.  This will likely be available as an
option in the not-too-distant-future.

=head1 ATTRIBUTE OPTIONS

We install an attribute metaclass trait that provides two additional
attribute options, as well as wraps the generated clearer method for a
designated "master" attribute.  By default, using this module causes this
trait to be installed for all attributes in the package.

lib/MooseX/CascadeClearing.pm  view on Meta::CPAN

=item clear_master => < attribute_name >

Marks this attribute as one that should be cleared when the named attribute's
clearer is called.  Note that no checking is done to ensure that the named
master is actually an attribute in the class.

=back

=head1 SOURCE

The development version is on github at L<http://github.com/RsrchBoy/moosex-cascadeclearing>
and may be cloned from L<git://github.com/RsrchBoy/moosex-cascadeclearing.git>

=head1 BUGS

Please report any bugs or feature requests on the bugtracker website
https://github.com/RsrchBoy/moosex-cascadeclearing/issues

When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.

=head1 AUTHOR

Chris Weyl <cweyl@alumni.drew.edu>

=head1 COPYRIGHT AND LICENSE



( run in 0.639 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )