Class: Exerb::Recipe::ResourceBlock::IconBlock
- Inherits:
-
Object
- Object
- Exerb::Recipe::ResourceBlock::IconBlock
- Defined in:
- lib/exerb/recipe.rb
Defined Under Namespace
Classes: Entry
Instance Attribute Summary collapse
-
#entries ⇒ Object
readonly
Returns the value of attribute entries.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(block, filename) ⇒ IconBlock
constructor
A new instance of IconBlock.
Constructor Details
#initialize(block, filename) ⇒ IconBlock
Returns a new instance of IconBlock.
246 247 248 |
# File 'lib/exerb/recipe.rb', line 246 def initialize(block, filename) @entries = block.collect { |hash| Entry.analyze(hash, filename) } end |
Instance Attribute Details
#entries ⇒ Object (readonly)
Returns the value of attribute entries.
250 251 252 |
# File 'lib/exerb/recipe.rb', line 250 def entries @entries end |
Class Method Details
.analyze(blocks, filename) ⇒ Object
252 253 254 255 256 257 |
# File 'lib/exerb/recipe.rb', line 252 def self.analyze(blocks, filename) block = blocks.delete("icon") return nil if block.nil? raise(Exerb::ExerbError, "#{filename}: icon block must be Array object -- #{block.type}") unless block.kind_of?(Array) return self.new(block, filename) end |