Class: Exerb::Recipe::PathBlock
- Inherits:
-
Object
- Object
- Exerb::Recipe::PathBlock
- Defined in:
- lib/exerb/recipe.rb
Overview
#
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(block, filename) ⇒ PathBlock
constructor
A new instance of PathBlock.
Constructor Details
#initialize(block, filename) ⇒ PathBlock
Returns a new instance of PathBlock.
207 208 209 210 211 212 |
# File 'lib/exerb/recipe.rb', line 207 def initialize(block, filename) @path = block.collect { |entry| raise(Exerb::ExerbError, "#{filename}: path block entries must be String object -- #{entry.type}") unless entry.kind_of?(String) entry.strip } end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
214 215 216 |
# File 'lib/exerb/recipe.rb', line 214 def path @path end |
Class Method Details
.analyze(blocks, filename) ⇒ Object
216 217 218 219 220 221 |
# File 'lib/exerb/recipe.rb', line 216 def self.analyze(blocks, filename) block = blocks.delete("path") return nil if block.nil? raise(Exerb::ExerbError, "#{filename}: path block must be Array object -- #{block.class}") unless block.kind_of?(Array) return self.new(block, filename) end |