Class: WordSearch::TwoDimensional::Point
- Inherits:
-
Object
- Object
- WordSearch::TwoDimensional::Point
- Defined in:
- lib/word_search/two_dimensional/point.rb
Instance Attribute Summary collapse
-
#letter ⇒ Object
(also: #to_s)
Returns the value of attribute letter.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #coordinate ⇒ Object
-
#initialize(x, y, letter = nil) ⇒ Point
constructor
A new instance of Point.
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
#letter ⇒ Object 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 |
#x ⇒ Object
Returns the value of attribute x.
6 7 8 |
# File 'lib/word_search/two_dimensional/point.rb', line 6 def x @x end |
#y ⇒ Object
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
#coordinate ⇒ Object
15 16 17 |
# File 'lib/word_search/two_dimensional/point.rb', line 15 def coordinate [x, y] end |