Class: RubyJard::Templates::LayoutTemplate

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_jard/templates/layout_template.rb

Overview

Template of a layout. Templates are hierarchy. Each template includes the sizing configuration, including absolute values, min, max, or ratio relative to its parant.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(height_ratio: nil, width_ratio: nil, min_width: nil, min_height: nil, height: nil, width: nil, children: [], fill_width: true, fill_height: true) ⇒ LayoutTemplate

Returns a new instance of LayoutTemplate.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/ruby_jard/templates/layout_template.rb', line 16

def initialize(
  height_ratio: nil, width_ratio: nil,
  min_width: nil, min_height: nil,
  height: nil, width: nil,
  children: [],
  fill_width: true, fill_height: true
)
  @height_ratio = height_ratio
  @width_ratio = width_ratio
  @min_width = min_width
  @min_height = min_height
  @height = height
  @width = width
  @children = children
  @fill_width = fill_width
  @fill_height = fill_height
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



10
11
12
# File 'lib/ruby_jard/templates/layout_template.rb', line 10

def children
  @children
end

#fill_heightObject (readonly)

Returns the value of attribute fill_height.



10
11
12
# File 'lib/ruby_jard/templates/layout_template.rb', line 10

def fill_height
  @fill_height
end

#fill_widthObject (readonly)

Returns the value of attribute fill_width.



10
11
12
# File 'lib/ruby_jard/templates/layout_template.rb', line 10

def fill_width
  @fill_width
end

#heightObject (readonly)

Returns the value of attribute height.



10
11
12
# File 'lib/ruby_jard/templates/layout_template.rb', line 10

def height
  @height
end

#height_ratioObject (readonly)

Returns the value of attribute height_ratio.



10
11
12
# File 'lib/ruby_jard/templates/layout_template.rb', line 10

def height_ratio
  @height_ratio
end

#min_heightObject (readonly)

Returns the value of attribute min_height.



10
11
12
# File 'lib/ruby_jard/templates/layout_template.rb', line 10

def min_height
  @min_height
end

#min_widthObject (readonly)

Returns the value of attribute min_width.



10
11
12
# File 'lib/ruby_jard/templates/layout_template.rb', line 10

def min_width
  @min_width
end

#widthObject (readonly)

Returns the value of attribute width.



10
11
12
# File 'lib/ruby_jard/templates/layout_template.rb', line 10

def width
  @width
end

#width_ratioObject (readonly)

Returns the value of attribute width_ratio.



10
11
12
# File 'lib/ruby_jard/templates/layout_template.rb', line 10

def width_ratio
  @width_ratio
end