class Dieses::Geometry::Point::Mutable

Attributes

x[W]
y[W]

Public Class Methods

cast(immutable_point) click to toggle source
# File lib/dieses/geometry/point.rb, line 92
def self.cast(immutable_point)
  Mutable.new(immutable_point.x, immutable_point.y)
end
new(x, y) click to toggle source
# File lib/dieses/geometry/point.rb, line 77
def initialize(x, y) # rubocop:disable Lint/MissingSuper
  @x, @y = x.to_f, y.to_f
end

Public Instance Methods

hash() click to toggle source
# File lib/dieses/geometry/point.rb, line 81
def hash
  (@hash ||= self.class.hash) ^ to_a.hash
end
translate!(x: nil, y: nil) click to toggle source
# File lib/dieses/geometry/point.rb, line 85
def translate!(x: nil, y: nil)
  tap do
    self.x += (x || 0)
    self.y += (y || 0)
  end
end