Class: Knossos::Cell
- Inherits:
-
Object
- Object
- Knossos::Cell
- Defined in:
- lib/knossos/cell.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#contents ⇒ Object
Returns the value of attribute contents.
-
#links ⇒ Object
readonly
Returns the value of attribute links.
-
#row ⇒ Object
readonly
Returns the value of attribute row.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Cell
constructor
A new instance of Cell.
- #link_to(cell) ⇒ Object
- #linked?(cell) ⇒ Boolean
Constructor Details
#initialize(args = {}) ⇒ Cell
Returns a new instance of Cell.
6 7 8 9 10 11 12 13 14 |
# File 'lib/knossos/cell.rb', line 6 def initialize(args = {}) args = defaults.merge(args) @row = args[:row] @column = args[:column] @contents = args[:contents] @links = [] end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
3 4 5 |
# File 'lib/knossos/cell.rb', line 3 def column @column end |
#contents ⇒ Object
Returns the value of attribute contents.
4 5 6 |
# File 'lib/knossos/cell.rb', line 4 def contents @contents end |
#links ⇒ Object (readonly)
Returns the value of attribute links.
3 4 5 |
# File 'lib/knossos/cell.rb', line 3 def links @links end |
#row ⇒ Object (readonly)
Returns the value of attribute row.
3 4 5 |
# File 'lib/knossos/cell.rb', line 3 def row @row end |
Instance Method Details
#link_to(cell) ⇒ Object
16 17 18 |
# File 'lib/knossos/cell.rb', line 16 def link_to(cell) @links << cell end |
#linked?(cell) ⇒ Boolean
20 21 22 |
# File 'lib/knossos/cell.rb', line 20 def linked?(cell) @links.include? cell end |