Module: Crucigrama::Positionable

Included in:
Crossword, CrosswordBuilder
Defined in:
lib/crucigrama/positionable.rb

Overview

This module defines some methods of use to interact with Crosswords

Instance Method Summary collapse

Instance Method Details

#direction_other_than(direction) ⇒ Symbol?



16
17
18
# File 'lib/crucigrama/positionable.rb', line 16

def direction_other_than(direction)
  { :horizontal => :vertical, :vertical => :horizontal}[direction]
end

#position(x, y) ⇒ Hash<Symbol,Integer>



7
8
9
# File 'lib/crucigrama/positionable.rb', line 7

def position(x,y)
  {:horizontal => x, :vertical => y}
end