Class: Vedeu::Geometry::Coordinate

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/vedeu/geometry/coordinate.rb

Overview

Crudely corrects out of range values.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, oy, ox) ⇒ Vedeu::Geometry::Coordinate

Returns a new instance of Vedeu::Geometry::Coordinate.

Parameters:

  • name (String)
  • oy (Fixnum)
  • ox (Fixnum)


25
26
27
28
29
# File 'lib/vedeu/geometry/coordinate.rb', line 25

def initialize(name, oy, ox)
  @name = name
  @ox   = ox
  @oy   = oy
end

Instance Attribute Details

#nameString (readonly, protected)

Returns:

  • (String)


35
36
37
# File 'lib/vedeu/geometry/coordinate.rb', line 35

def name
  @name
end

#oxFixnum (protected)

Returns:

  • (Fixnum)


39
40
41
# File 'lib/vedeu/geometry/coordinate.rb', line 39

def ox
  @ox
end

#oyFixnum (protected)

Returns:

  • (Fixnum)


43
44
45
# File 'lib/vedeu/geometry/coordinate.rb', line 43

def oy
  @oy
end

Instance Method Details

#xVedeu::Geometry::GenericCoordinate (private)

Provide an instance of Vedeu::Geometry::GenericCoordinate to determine correct x related coordinates.



51
52
53
54
55
# File 'lib/vedeu/geometry/coordinate.rb', line 51

def x
  @x ||= Vedeu::Geometry::GenericCoordinate.new(name:   name,
                                                offset: ox,
                                                type:   :x)
end

#yVedeu::Geometry::GenericCoordinate (private)

Provide an instance of Vedeu::Geometry::GenericCoordinate to determine correct y related coordinates.



61
62
63
64
65
# File 'lib/vedeu/geometry/coordinate.rb', line 61

def y
  @y ||= Vedeu::Geometry::GenericCoordinate.new(name:   name,
                                                offset: oy,
                                                type:   :y)
end