Class: Vedeu::Models::Cell Private
- Inherits:
-
Object
- Object
- Vedeu::Models::Cell
- Includes:
- Repositories::Defaults
- Defined in:
- lib/vedeu/models/cell.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
A Cell represents a single square of the terminal.
Instance Attribute Summary collapse
- #colour ⇒ NilClass|String readonly private
- #name ⇒ String|Symbol readonly private
- #style ⇒ NilClass|Array<Symbol|String>|Symbol|String readonly private
- #value ⇒ NilClass|String readonly private
Instance Method Summary collapse
- #cell? ⇒ Boolean private
-
#defaults ⇒ Hash<Symbol => void>
private
private
Returns the default options/attributes for this class.
-
#eql?(other) ⇒ Boolean
(also: #==)
private
An object is equal when its values are the same.
-
#initialize(attributes = {}) ⇒ void
included
from Repositories::Defaults
private
Returns a new instance of the class including this module.
- #interface ⇒ Vedeu::Interfaces::Interface private
- #position ⇒ Vedeu::Geometry::Position private
- #to_hash ⇒ Hash private
- #to_html(_options = {}) ⇒ String private
- #to_s ⇒ String private
Instance Attribute Details
#colour ⇒ NilClass|String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
15 16 17 |
# File 'lib/vedeu/models/cell.rb', line 15 def colour @colour end |
#name ⇒ String|Symbol (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/vedeu/models/cell.rb', line 19 def name @name end |
#style ⇒ NilClass|Array<Symbol|String>|Symbol|String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 |
# File 'lib/vedeu/models/cell.rb', line 23 def style @style end |
#value ⇒ NilClass|String (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
27 28 29 |
# File 'lib/vedeu/models/cell.rb', line 27 def value @value end |
Instance Method Details
#cell? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
30 31 32 |
# File 'lib/vedeu/models/cell.rb', line 30 def cell? true end |
#defaults ⇒ Hash<Symbol => void> (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns the default options/attributes for this class.
80 81 82 83 84 85 86 87 88 |
# File 'lib/vedeu/models/cell.rb', line 80 def defaults { colour: nil, name: nil, style: nil, value: '', position: [1, 1], } end |
#eql?(other) ⇒ Boolean Also known as: ==
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
An object is equal when its values are the same.
38 39 40 41 |
# File 'lib/vedeu/models/cell.rb', line 38 def eql?(other) self.class == other.class && value == other.value && position == other.position end |
#initialize(attributes = {}) ⇒ void Originally defined in module Repositories::Defaults
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
If a particular key is missing from the attributes parameter, then it is added with the respective value from #defaults.
Returns a new instance of the class including this module.
#interface ⇒ Vedeu::Interfaces::Interface
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
45 46 47 |
# File 'lib/vedeu/models/cell.rb', line 45 def interface @interface ||= Vedeu.interfaces.by_name(name) end |
#position ⇒ Vedeu::Geometry::Position
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
50 51 52 |
# File 'lib/vedeu/models/cell.rb', line 50 def position Vedeu::Geometry::Position.coerce(@position) end |
#to_hash ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
55 56 57 58 59 60 61 62 |
# File 'lib/vedeu/models/cell.rb', line 55 def to_hash { colour: colour.to_s, style: style.to_s, value: value.to_s, position: position.to_s, } end |
#to_html(_options = {}) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
66 67 68 |
# File 'lib/vedeu/models/cell.rb', line 66 def to_html( = {}) '' end |
#to_s ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
71 72 73 |
# File 'lib/vedeu/models/cell.rb', line 71 def to_s value.to_s end |