Class: Argyle::Layout::Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/argyle/layout/factory.rb

Instance Method Summary collapse

Instance Method Details

#create(klass) ⇒ Argyle::Layout::Base

Parameters:

Returns:

Raises:



8
9
10
11
12
13
14
15
16
# File 'lib/argyle/layout/factory.rb', line 8

def create(klass)
  Argyle::Assert.klass(Argyle::Layout::Base, klass)

  areas = klass.area_prototypes.transform_values(&:unwrap)

  windows = areas.map(&method(:create_window)).to_h

  klass.new(areas, windows)
end