Class: WordSearch::ThreeDimensional::Point

Inherits:
Object
  • Object
show all
Defined in:
lib/word_search/three_dimensional/point.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x, y, z, letter = nil) ⇒ Point

Returns a new instance of Point.



9
10
11
12
13
14
# File 'lib/word_search/three_dimensional/point.rb', line 9

def initialize(x, y, z, letter = nil)
  @x = x
  @y = y
  @z = z
  @letter = letter if letter
end

Instance Attribute Details

#letterObject Also known as: to_s

Returns the value of attribute letter.



6
7
8
# File 'lib/word_search/three_dimensional/point.rb', line 6

def letter
  @letter
end

#xObject

Returns the value of attribute x.



6
7
8
# File 'lib/word_search/three_dimensional/point.rb', line 6

def x
  @x
end

#yObject

Returns the value of attribute y.



6
7
8
# File 'lib/word_search/three_dimensional/point.rb', line 6

def y
  @y
end

#zObject

Returns the value of attribute z.



6
7
8
# File 'lib/word_search/three_dimensional/point.rb', line 6

def z
  @z
end

Instance Method Details

#coordinateObject



16
17
18
# File 'lib/word_search/three_dimensional/point.rb', line 16

def coordinate
  [x, y, z]
end