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
342 343 344 345 346 347 |
# File 'lib/exerb/recipe.rb', line 342 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
349 350 351 |
# File 'lib/exerb/recipe.rb', line 349 def [](key) return @file[key] end |
#delete(key) ⇒ Object
361 362 363 |
# File 'lib/exerb/recipe.rb', line 361 def delete(key) return @file.delete(key) end |
#each(&block) ⇒ Object
353 354 355 |
# File 'lib/exerb/recipe.rb', line 353 def each(&block) return @file.each(&block) end |
#keys ⇒ Object
357 358 359 |
# File 'lib/exerb/recipe.rb', line 357 def keys return @file.keys end |