Class: Point
- Inherits:
-
Object
- Object
- Point
- Defined in:
- lib/World.rb
Instance Attribute Summary collapse
-
#x ⇒ Object
readonly
Returns the value of attribute x.
-
#y ⇒ Object
readonly
Returns the value of attribute y.
-
#z ⇒ Object
readonly
Returns the value of attribute z.
Instance Method Summary collapse
-
#initialize(x, y, z) ⇒ Point
constructor
A new instance of Point.
- #to_s ⇒ Object
Constructor Details
#initialize(x, y, z) ⇒ Point
Returns a new instance of Point.
12 13 14 15 16 |
# File 'lib/World.rb', line 12 def initialize(x, y, z) @x = x @y = y @z = z end |
Instance Attribute Details
#x ⇒ Object (readonly)
Returns the value of attribute x.
10 11 12 |
# File 'lib/World.rb', line 10 def x @x end |
#y ⇒ Object (readonly)
Returns the value of attribute y.
10 11 12 |
# File 'lib/World.rb', line 10 def y @y end |
#z ⇒ Object (readonly)
Returns the value of attribute z.
10 11 12 |
# File 'lib/World.rb', line 10 def z @z end |
Instance Method Details
#to_s ⇒ Object
18 19 20 |
# File 'lib/World.rb', line 18 def to_s "#{@x},#{@y},#{@z}" end |