class Square
square.rb
Attributes
size[R]
Public Class Methods
new(x=0, y=0, s=100, c="white", visible=true)
click to toggle source
# File lib/r2d/square.rb, line 7 def initialize(x=0, y=0, s=100, c="white", visible=true) @x, @y, @color = x, y, c @width = @height = @size = s update_coords(x, y, s, s) update_color(c) if visible then add end end
Public Instance Methods
size=(s)
click to toggle source
# File lib/r2d/square.rb, line 15 def size=(s) self.width = self.height = @size = s end