Class: Vedeu::Cell
- Inherits:
-
Object
- Object
- Vedeu::Cell
- Defined in:
- lib/vedeu/models/cell.rb
Overview
A Cell represents a single square of the terminal.
Instance Attribute Summary collapse
- #colour ⇒ NilClass|String readonly
- #style ⇒ NilClass|Array<Symbol|String>|Symbol|String readonly
- #value ⇒ NilClass|String readonly
- #x ⇒ NilClass|Fixnum readonly
- #y ⇒ NilClass|Fixnum readonly
Instance Method Summary collapse
-
#eql?(other) ⇒ Boolean
(also: #==)
An object is equal when its values are the same.
-
#initialize(attributes = {}) ⇒ Vedeu::Cell
constructor
Returns a new instance of Vedeu::Cell.
Constructor Details
#initialize(attributes = {}) ⇒ Vedeu::Cell
Returns a new instance of Vedeu::Cell.
36 37 38 39 40 41 42 |
# File 'lib/vedeu/models/cell.rb', line 36 def initialize(attributes = {}) @colour = attributes[:colour] @style = attributes[:style] @value = attributes[:value] @x = attributes[:x] @y = attributes[:y] end |
Instance Attribute Details
#colour ⇒ NilClass|String (readonly)
8 9 10 |
# File 'lib/vedeu/models/cell.rb', line 8 def colour @colour end |
#style ⇒ NilClass|Array<Symbol|String>|Symbol|String (readonly)
12 13 14 |
# File 'lib/vedeu/models/cell.rb', line 12 def style @style end |
#value ⇒ NilClass|String (readonly)
16 17 18 |
# File 'lib/vedeu/models/cell.rb', line 16 def value @value end |
#x ⇒ NilClass|Fixnum (readonly)
20 21 22 |
# File 'lib/vedeu/models/cell.rb', line 20 def x @x end |
#y ⇒ NilClass|Fixnum (readonly)
24 25 26 |
# File 'lib/vedeu/models/cell.rb', line 24 def y @y end |
Instance Method Details
#eql?(other) ⇒ Boolean Also known as: ==
An object is equal when its values are the same.
48 49 50 51 52 |
# File 'lib/vedeu/models/cell.rb', line 48 def eql?(other) self.class == other.class && colour == other.colour && style == other.style && value == other.value && x == other.x && y == other.y end |