Module: Hyperactive::Cleaner::Accessors
- Included in:
- Hash::Element, Hash::Head, Tree::Node, Tree::Root
- Defined in:
- lib/hyperactive/cleaner.rb
Overview
Include this to get the new accessor methods that automatically check if you are dirty.
Defined Under Namespace
Modules: ClassMethods
Class Method Summary collapse
-
.append_features(base) ⇒ Object
The
base
class including this will get a our ClassMethods as well.
Instance Method Summary collapse
-
#dirty? ⇒ Boolean
Replies whether we are dirty.
-
#is_clean! ⇒ Object
Mark us as clean.
-
#is_dirty! ⇒ Object
Mark us as dirty.
Class Method Details
.append_features(base) ⇒ Object
The base
class including this will get a our ClassMethods as well.
33 34 35 36 |
# File 'lib/hyperactive/cleaner.rb', line 33 def self.append_features(base) super base.extend(ClassMethods) end |
Instance Method Details
#dirty? ⇒ Boolean
Replies whether we are dirty.
41 42 43 |
# File 'lib/hyperactive/cleaner.rb', line 41 def dirty? @dirty ||= false end |
#is_clean! ⇒ Object
Mark us as clean.
55 56 57 |
# File 'lib/hyperactive/cleaner.rb', line 55 def is_clean! @dirty = false end |
#is_dirty! ⇒ Object
Mark us as dirty.
48 49 50 |
# File 'lib/hyperactive/cleaner.rb', line 48 def is_dirty! @dirty = true end |