Class: Point

Inherits:
Object
  • Object
show all
Defined in:
lib/World.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#xObject (readonly)

Returns the value of attribute x.



10
11
12
# File 'lib/World.rb', line 10

def x
  @x
end

#yObject (readonly)

Returns the value of attribute y.



10
11
12
# File 'lib/World.rb', line 10

def y
  @y
end

#zObject (readonly)

Returns the value of attribute z.



10
11
12
# File 'lib/World.rb', line 10

def z
  @z
end

Instance Method Details

#to_sObject



18
19
20
# File 'lib/World.rb', line 18

def to_s
    "#{@x},#{@y},#{@z}"
end