Class: Kamaze::Project::Tools::BaseTool Abstract
- Inherits:
-
Observable
- Object
- Observable
- Kamaze::Project::Tools::BaseTool
- Defined in:
- lib/kamaze/project/tools/base_tool.rb
Overview
This class is abstract.
Provides base for tools
Direct Known Subclasses
Console, Gemspec::Reader, Gemspec::Writer, Git, Licenser, Packager, ProcessLocker, Rspec, Rubocop, Shell, Vagrant, Yardoc, Yardoc::Watcher
Instance Attribute Summary collapse
- #observer_peers ⇒ Hash|nil included from Concern::Observable readonly protected
Instance Method Summary collapse
-
#attrs_mute! ⇒ self
protected
Mut(at)e attributes.
-
#initialize ⇒ BaseTool
constructor
A new instance of BaseTool.
-
#mutable_attributes ⇒ Array
Mutable attributes.
-
#setup ⇒ Object
protected
Execute additionnal setup.
Constructor Details
#initialize ⇒ BaseTool
Returns a new instance of BaseTool.
16 17 18 19 20 21 22 23 24 |
# File 'lib/kamaze/project/tools/base_tool.rb', line 16 def initialize super() dispatch_event(:before_setup) setup dispatch_event(:after_setup) attrs_mute! end |
Instance Attribute Details
#observer_peers ⇒ Hash|nil (readonly, protected) Originally defined in module Concern::Observable
Instance Method Details
#attrs_mute! ⇒ self (protected)
Mut(at)e attributes
After initialization, attributes given has mutable
become ro
(protected setter)
48 49 50 51 52 53 54 |
# File 'lib/kamaze/project/tools/base_tool.rb', line 48 def attrs_mute! mutable_attributes.each do |m| self.singleton_class.class_eval { protected "#{m}=" } end self end |
#mutable_attributes ⇒ Array
Mutable attributes
Mutable attributes become ro
after initialization
31 32 33 |
# File 'lib/kamaze/project/tools/base_tool.rb', line 31 def mutable_attributes [] end |
#setup ⇒ Object (protected)
Execute additionnal setup
38 39 40 |
# File 'lib/kamaze/project/tools/base_tool.rb', line 38 def setup nil end |