Class: Vedeu::Geometry::Coordinate
- Inherits:
-
Object
- Object
- Vedeu::Geometry::Coordinate
- Extended by:
- Forwardable
- Defined in:
- lib/vedeu/geometry/coordinate.rb
Overview
Crudely corrects out of range values.
Instance Attribute Summary collapse
- #name ⇒ String readonly protected
- #ox ⇒ Fixnum protected
- #oy ⇒ Fixnum protected
Instance Method Summary collapse
-
#initialize(name, oy, ox) ⇒ Vedeu::Geometry::Coordinate
constructor
Returns a new instance of Vedeu::Geometry::Coordinate.
-
#x ⇒ Vedeu::Geometry::GenericCoordinate
private
Provide an instance of Vedeu::Geometry::GenericCoordinate to determine correct x related coordinates.
-
#y ⇒ Vedeu::Geometry::GenericCoordinate
private
Provide an instance of Vedeu::Geometry::GenericCoordinate to determine correct y related coordinates.
Constructor Details
#initialize(name, oy, ox) ⇒ Vedeu::Geometry::Coordinate
Returns a new instance of Vedeu::Geometry::Coordinate.
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
#name ⇒ String (readonly, protected)
35 36 37 |
# File 'lib/vedeu/geometry/coordinate.rb', line 35 def name @name end |
#ox ⇒ Fixnum (protected)
39 40 41 |
# File 'lib/vedeu/geometry/coordinate.rb', line 39 def ox @ox end |
#oy ⇒ Fixnum (protected)
43 44 45 |
# File 'lib/vedeu/geometry/coordinate.rb', line 43 def oy @oy end |
Instance Method Details
#x ⇒ Vedeu::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 |
#y ⇒ Vedeu::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 |