Class: WordSearch::TwoDimensional::Point

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Point.



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

def initialize(x, y, letter = nil)
  @x = x
  @y = y
  @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/two_dimensional/point.rb', line 6

def letter
  @letter
end

#xObject

Returns the value of attribute x.



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

def x
  @x
end

#yObject

Returns the value of attribute y.



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

def y
  @y
end

Instance Method Details

#coordinateObject



15
16
17
# File 'lib/word_search/two_dimensional/point.rb', line 15

def coordinate
  [x, y]
end