Class: Exerb::Recipe::ResourceBlock::IconBlock

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

Defined Under Namespace

Classes: Entry

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(block, filename) ⇒ IconBlock

Returns a new instance of IconBlock.



240
241
242
# File 'lib/exerb/recipe.rb', line 240

def initialize(block, filename)
  @entries = block.collect { |hash| Entry.analyze(hash, filename) }
end

Instance Attribute Details

#entriesObject (readonly)

Returns the value of attribute entries.



244
245
246
# File 'lib/exerb/recipe.rb', line 244

def entries
  @entries
end

Class Method Details

.analyze(blocks, filename) ⇒ Object

Raises:



246
247
248
249
250
251
# File 'lib/exerb/recipe.rb', line 246

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