Class: ExactCover::DataObject

Inherits:
Object
  • Object
show all
Defined in:
lib/exact_cover/data_object.rb

Overview

represents a “1” in the given matrix

Direct Known Subclasses

ColumnObject

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(column) ⇒ DataObject

Returns a new instance of DataObject.

Parameters:



8
9
10
11
12
13
14
# File 'lib/exact_cover/data_object.rb', line 8

def initialize(column)
  @column = column
  @left = nil
  @right = nil
  @up = nil
  @down = nil
end

Instance Attribute Details

#columnObject (readonly)

link to column object



5
6
7
# File 'lib/exact_cover/data_object.rb', line 5

def column
  @column
end

#downObject

left, right, up and down links



4
5
6
# File 'lib/exact_cover/data_object.rb', line 4

def down
  @down
end

#leftObject

left, right, up and down links



4
5
6
# File 'lib/exact_cover/data_object.rb', line 4

def left
  @left
end

#rightObject

left, right, up and down links



4
5
6
# File 'lib/exact_cover/data_object.rb', line 4

def right
  @right
end

#upObject

left, right, up and down links



4
5
6
# File 'lib/exact_cover/data_object.rb', line 4

def up
  @up
end