Class: MapPoint::PointBuilder
- Inherits:
-
Object
- Object
- MapPoint::PointBuilder
- Defined in:
- lib/map/point.rb
Overview
Point builder class
Instance Attribute Summary collapse
-
#point ⇒ Object
readonly
Returns the value of attribute point.
Instance Method Summary collapse
- #add_x(x) ⇒ Object
- #add_y(y) ⇒ Object
- #add_z(z) ⇒ Object
-
#build_point(x, y, z) ⇒ Object
Builds the point of a node.
-
#initialize ⇒ PointBuilder
constructor
A new instance of PointBuilder.
Constructor Details
#initialize ⇒ PointBuilder
Returns a new instance of PointBuilder.
41 42 43 |
# File 'lib/map/point.rb', line 41 def initialize() @point = Point.new() end |
Instance Attribute Details
#point ⇒ Object (readonly)
Returns the value of attribute point.
45 46 47 |
# File 'lib/map/point.rb', line 45 def point @point end |
Instance Method Details
#add_x(x) ⇒ Object
54 55 56 |
# File 'lib/map/point.rb', line 54 def add_x(x) @point.x = x end |
#add_y(y) ⇒ Object
58 59 60 |
# File 'lib/map/point.rb', line 58 def add_y(y) @point.y = y end |
#add_z(z) ⇒ Object
62 63 64 |
# File 'lib/map/point.rb', line 62 def add_z(z) @point.z = z end |
#build_point(x, y, z) ⇒ Object
Builds the point of a node
48 49 50 51 52 |
# File 'lib/map/point.rb', line 48 def build_point(x, y, z) add_x(x.to_i) add_y(y.to_i) add_z(z.to_i) end |