Class: ExactCover::DataObject
- Inherits:
-
Object
- Object
- ExactCover::DataObject
- Defined in:
- lib/exact_cover/data_object.rb
Overview
represents a “1” in the given matrix
Direct Known Subclasses
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
link to column object.
-
#down ⇒ Object
left, right, up and down links.
-
#left ⇒ Object
left, right, up and down links.
-
#right ⇒ Object
left, right, up and down links.
-
#up ⇒ Object
left, right, up and down links.
Instance Method Summary collapse
-
#initialize(column) ⇒ DataObject
constructor
A new instance of DataObject.
Constructor Details
#initialize(column) ⇒ DataObject
Returns a new instance of DataObject.
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
#column ⇒ Object (readonly)
link to column object
5 6 7 |
# File 'lib/exact_cover/data_object.rb', line 5 def column @column end |
#down ⇒ Object
left, right, up and down links
4 5 6 |
# File 'lib/exact_cover/data_object.rb', line 4 def down @down end |
#left ⇒ Object
left, right, up and down links
4 5 6 |
# File 'lib/exact_cover/data_object.rb', line 4 def left @left end |
#right ⇒ Object
left, right, up and down links
4 5 6 |
# File 'lib/exact_cover/data_object.rb', line 4 def right @right end |
#up ⇒ Object
left, right, up and down links
4 5 6 |
# File 'lib/exact_cover/data_object.rb', line 4 def up @up end |