Class: LessCurse::Geometry::Rectangle

Inherits:
Object
  • Object
show all
Defined in:
lib/less_curse/geometry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, width, height) ⇒ Rectangle

Returns a new instance of Rectangle.



19
20
21
# File 'lib/less_curse/geometry.rb', line 19

def initialize(x, y, width, height)
  @position, @size = Point.new(x, y), Size.new(width, height)
end

Instance Attribute Details

#positionObject

Returns the value of attribute position.



18
19
20
# File 'lib/less_curse/geometry.rb', line 18

def position
  @position
end

#sizeObject

Returns the value of attribute size.



18
19
20
# File 'lib/less_curse/geometry.rb', line 18

def size
  @size
end