Class: Exerb::Recipe::PathBlock

Inherits:
Object
  • Object
show all
Defined in:
lib/exerb/recipe.rb

Overview

#

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block, filename) ⇒ PathBlock

Returns a new instance of PathBlock



201
202
203
204
205
206
# File 'lib/exerb/recipe.rb', line 201

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

#pathObject (readonly)

Returns the value of attribute path



208
209
210
# File 'lib/exerb/recipe.rb', line 208

def path
  @path
end

Class Method Details

.analyze(blocks, filename) ⇒ Object

Raises:



210
211
212
213
214
215
# File 'lib/exerb/recipe.rb', line 210

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