Class: BinPacking::FreeSpaceBox

Inherits:
Object
  • Object
show all
Defined in:
lib/bin_packing/free_space_box.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width, height) ⇒ FreeSpaceBox

Returns a new instance of FreeSpaceBox.



5
6
7
8
9
10
# File 'lib/bin_packing/free_space_box.rb', line 5

def initialize(width, height)
  @width = width
  @height = height
  @x = 0
  @y = 0
end

Instance Attribute Details

#heightObject

Returns the value of attribute height.



3
4
5
# File 'lib/bin_packing/free_space_box.rb', line 3

def height
  @height
end

#widthObject

Returns the value of attribute width.



3
4
5
# File 'lib/bin_packing/free_space_box.rb', line 3

def width
  @width
end

#xObject

Returns the value of attribute x.



3
4
5
# File 'lib/bin_packing/free_space_box.rb', line 3

def x
  @x
end

#yObject

Returns the value of attribute y.



3
4
5
# File 'lib/bin_packing/free_space_box.rb', line 3

def y
  @y
end