Class: Exerb::Recipe::ResourceBlock::IconBlock::Entry
- Inherits:
-
Object
- Object
- Exerb::Recipe::ResourceBlock::IconBlock::Entry
- Defined in:
- lib/exerb/recipe.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(block, filename) ⇒ Entry
constructor
A new instance of Entry.
Constructor Details
#initialize(block, filename) ⇒ Entry
Returns a new instance of Entry.
255 256 257 258 259 260 261 262 |
# File 'lib/exerb/recipe.rb', line 255 def initialize(block, filename) @width = block.delete("width") @height = block.delete("height") @color = block.delete("color") @file = block.delete("file") raise(Exerb::ExerbError, "#{filename}: unknown field at icon block entry -- #{block.keys.join(', ')}") unless block.empty? end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
264 265 266 |
# File 'lib/exerb/recipe.rb', line 264 def color @color end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
264 265 266 |
# File 'lib/exerb/recipe.rb', line 264 def file @file end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
264 265 266 |
# File 'lib/exerb/recipe.rb', line 264 def height @height end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
264 265 266 |
# File 'lib/exerb/recipe.rb', line 264 def width @width end |
Class Method Details
.analyze(block, filename) ⇒ Object
266 267 268 269 |
# File 'lib/exerb/recipe.rb', line 266 def self.analyze(block, filename) raise(Exerb::ExerbError, "#{filename}: icon block entry must be Hash object -- #{block.type}") unless block.kind_of?(Hash) return self.new(block, filename) end |