Class: Kicker::Recipes::Base
- Inherits:
-
Object
- Object
- Kicker::Recipes::Base
- Defined in:
- lib/kicker/recipes/base.rb
Direct Known Subclasses
Defined Under Namespace
Classes: NotImplementedError
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
-
#kicker ⇒ Object
readonly
Returns the value of attribute kicker.
Class Method Summary collapse
Instance Method Summary collapse
- #handle! ⇒ Object
-
#initialize(kicker, files) ⇒ Base
constructor
A new instance of Base.
- #relative_path(path) ⇒ Object
Constructor Details
#initialize(kicker, files) ⇒ Base
Returns a new instance of Base.
12 13 14 15 |
# File 'lib/kicker/recipes/base.rb', line 12 def initialize(kicker, files) @kicker, @files = kicker, files after_initialize if respond_to?(:after_initialize) end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
10 11 12 |
# File 'lib/kicker/recipes/base.rb', line 10 def files @files end |
#kicker ⇒ Object (readonly)
Returns the value of attribute kicker.
10 11 12 |
# File 'lib/kicker/recipes/base.rb', line 10 def kicker @kicker end |
Class Method Details
.call(kicker, files) ⇒ Object
6 7 8 |
# File 'lib/kicker/recipes/base.rb', line 6 def self.call(kicker, files) new(kicker, files).handle! end |
Instance Method Details
#handle! ⇒ Object
17 18 19 |
# File 'lib/kicker/recipes/base.rb', line 17 def handle! raise NotImplementedError, 'The subclass should implement this method to handle the changed files.' end |
#relative_path(path) ⇒ Object
21 22 23 |
# File 'lib/kicker/recipes/base.rb', line 21 def relative_path(path) path[(Dir.pwd.length + 1)..-1] end |