Class: Zyps::Location

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

Overview

An object’s location, with x and y coordinates.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x = 0, y = 0) ⇒ Location

Returns a new instance of Location.



447
448
449
# File 'lib/zyps.rb', line 447

def initialize (x = 0, y = 0)
	self.x, self.y = x, y
end

Instance Attribute Details

#xObject

Coordinates can be negative, and don’t have to be integers.



445
446
447
# File 'lib/zyps.rb', line 445

def x
  @x
end

#yObject

Coordinates can be negative, and don’t have to be integers.



445
446
447
# File 'lib/zyps.rb', line 445

def y
  @y
end

Instance Method Details

#copyObject

Make a deep copy.



452
# File 'lib/zyps.rb', line 452

def copy; self.clone; end