Class: RubyJard::Layout

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

Overview

Data object to store calculated layout

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template: nil, parent_template: nil, width: 0, height: 0, x: 0, y: 0, box_width: 0, box_height: 0, box_x: 0, box_y: 0) ⇒ Layout

Returns a new instance of Layout.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/ruby_jard/layout.rb', line 11

def initialize(
  template: nil, parent_template: nil,
  width: 0, height: 0, x: 0, y: 0,
  box_width: 0, box_height: 0, box_x: 0, box_y: 0
)
  @template = template
  @box_width = box_width
  @box_height = box_height
  @box_x = box_x
  @box_y = box_y
  @width = width
  @height = height
  @x = x
  @y = y
  @parent_template = parent_template
end

Instance Attribute Details

#box_heightObject

Returns the value of attribute box_height.



7
8
9
# File 'lib/ruby_jard/layout.rb', line 7

def box_height
  @box_height
end

#box_widthObject

Returns the value of attribute box_width.



7
8
9
# File 'lib/ruby_jard/layout.rb', line 7

def box_width
  @box_width
end

#box_xObject

Returns the value of attribute box_x.



7
8
9
# File 'lib/ruby_jard/layout.rb', line 7

def box_x
  @box_x
end

#box_yObject

Returns the value of attribute box_y.



7
8
9
# File 'lib/ruby_jard/layout.rb', line 7

def box_y
  @box_y
end

#heightObject

Returns the value of attribute height.



7
8
9
# File 'lib/ruby_jard/layout.rb', line 7

def height
  @height
end

#parent_templateObject

Returns the value of attribute parent_template.



7
8
9
# File 'lib/ruby_jard/layout.rb', line 7

def parent_template
  @parent_template
end

#templateObject

Returns the value of attribute template.



7
8
9
# File 'lib/ruby_jard/layout.rb', line 7

def template
  @template
end

#widthObject

Returns the value of attribute width.



7
8
9
# File 'lib/ruby_jard/layout.rb', line 7

def width
  @width
end

#xObject

Returns the value of attribute x.



7
8
9
# File 'lib/ruby_jard/layout.rb', line 7

def x
  @x
end

#yObject

Returns the value of attribute y.



7
8
9
# File 'lib/ruby_jard/layout.rb', line 7

def y
  @y
end