Class: Exerb::Recipe::FileBlock
- Inherits:
-
Object
- Object
- Exerb::Recipe::FileBlock
- Includes:
- Enumerable
- Defined in:
- lib/exerb/recipe.rb
Overview
#
Defined Under Namespace
Classes: FileEntry
Class Method Summary collapse
Instance Method Summary collapse
- #[](key) ⇒ Object
- #delete(key) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize(block, filename) ⇒ FileBlock
constructor
A new instance of FileBlock.
- #keys ⇒ Object
Constructor Details
Class Method Details
.analyze(blocks, filename) ⇒ Object
336 337 338 339 340 341 |
# File 'lib/exerb/recipe.rb', line 336 def self.analyze(blocks, filename) block = blocks.delete("file") raise(Exerb::ExerbError, "#{filename}: file block not found") if block.nil? raise(Exerb::ExerbError, "#{filename}: file block must be Hash object -- #{block.class}") unless block.kind_of?(Hash) return self.new(block, filename) end |
Instance Method Details
#[](key) ⇒ Object
343 344 345 |
# File 'lib/exerb/recipe.rb', line 343 def [](key) return @file[key] end |
#delete(key) ⇒ Object
355 356 357 |
# File 'lib/exerb/recipe.rb', line 355 def delete(key) return @file.delete(key) end |
#each(&block) ⇒ Object
347 348 349 |
# File 'lib/exerb/recipe.rb', line 347 def each(&block) return @file.each(&block) end |
#keys ⇒ Object
351 352 353 |
# File 'lib/exerb/recipe.rb', line 351 def keys return @file.keys end |