Class: Dieses::Application::Sheets::Thumbnail

Inherits:
Dieses::Application::Sheet show all
Defined in:
lib/dieses/application/sheets/thumbnail.rb

Constant Summary collapse

DENSITIES =
{
  '1': Param.(row: 5, col: 3, width: 10, height: 10),
  '2': Param.(row: 4, col: 4, width: 8,  height: 10),
  '3': Param.(row: 5, col: 5, width: 6,  height: 8),
  '4': Param.(row: 6, col: 5, width: 6,  height: 6)
}.freeze

Instance Attribute Summary

Attributes inherited from Dieses::Application::Sheet

#paper, #variant

Instance Method Summary collapse

Methods inherited from Dieses::Application::Sheet

default_variant, #initialize, #produce, variant!

Methods included from Dieses::Application::Sheet::DSL

extended, #sheet, #variant, #variate

Constructor Details

This class inherits a constructor from Dieses::Application::Sheet

Instance Method Details

#callObject



25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/dieses/application/sheets/thumbnail.rb', line 25

def call
  row, col, width, height = DENSITIES[param.density].to_a

  draw unit: param.unit do
    repeat row do
      repeat col do
        rect :rect, width: width, height: height
        right(width + 1.25)
      end
      down(height + 1.25)
    end
  end
end