Module: Crucigrama::Crossword::LineQuery

Included in:
Crucigrama::Crossword
Defined in:
lib/crucigrama/crossword/line_query.rb

Overview

This module provides methods for querying lines (rows or columns) on a crossword

Instance Method Summary collapse

Instance Method Details

#column(coordinate) ⇒ String

Returns the column with the specified number.

Parameters:

  • coordinate (Integer)

    a number between 0 and the vertical dimension of the crossword minus one specifying the queried column

Returns:

  • (String)

    the column with the specified number



13
14
15
# File 'lib/crucigrama/crossword/line_query.rb', line 13

def column(coordinate)
  line(coordinate, :vertical)
end

#row(coordinate) ⇒ String

Returns the row with the specified number.

Parameters:

  • coordinate (Integer)

    a number between 0 and the horizontal dimension of the crossword minus one specifying the queried row

Returns:

  • (String)

    the row with the specified number



6
7
8
# File 'lib/crucigrama/crossword/line_query.rb', line 6

def row(coordinate)
  line(coordinate, :horizontal)
end