Class: Kropka::Recipe
- Inherits:
-
Object
- Object
- Kropka::Recipe
- Defined in:
- lib/kropka/recipe.rb
Instance Attribute Summary collapse
-
#directories ⇒ Object
readonly
Returns the value of attribute directories.
-
#files ⇒ Object
readonly
Returns the value of attribute files.
Class Method Summary collapse
Instance Method Summary collapse
- #apply! ⇒ Object
-
#initialize(&block) ⇒ Recipe
constructor
A new instance of Recipe.
Constructor Details
#initialize(&block) ⇒ Recipe
Returns a new instance of Recipe.
7 8 9 10 11 12 13 14 |
# File 'lib/kropka/recipe.rb', line 7 def initialize(&block) self.directories = [] self.files = [] instance_eval(&block) if block_given? @@instance = self end |
Instance Attribute Details
#directories ⇒ Object
Returns the value of attribute directories.
21 22 23 |
# File 'lib/kropka/recipe.rb', line 21 def directories @directories end |
#files ⇒ Object
Returns the value of attribute files.
21 22 23 |
# File 'lib/kropka/recipe.rb', line 21 def files @files end |
Class Method Details
.instance ⇒ Object
3 4 5 |
# File 'lib/kropka/recipe.rb', line 3 def self.instance @@instance end |
Instance Method Details
#apply! ⇒ Object
16 17 18 19 |
# File 'lib/kropka/recipe.rb', line 16 def apply! directories.map(&:create!) files.map(&:copy!) end |