Class: Vedeu::Models::Escape Private
- Inherits:
-
Object
- Object
- Vedeu::Models::Escape
- Defined in:
- lib/vedeu/models/escape.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.
Represents an invisible escape character sequence.
Instance Attribute Summary collapse
- #value ⇒ String readonly private
Instance Method Summary collapse
- #cell? ⇒ Boolean private
- #defaults ⇒ Hash private private
-
#eql?(other) ⇒ Boolean
(also: #==)
private
An object is equal when its values are the same.
-
#initialize(attributes = {}) ⇒ Vedeu::Models::Escape
constructor
private
Returns a new instance of Vedeu::Models::Escape.
- #null ⇒ NilClass (also: #background, #colour, #foreground, #style) private
- #position ⇒ String private
-
#to_hash ⇒ Hash<void>
private
Return an empty hash as most escape sequences won’t make sense as JSON.
-
#to_html(_options = {}) ⇒ String
private
Return an empty string as most escape sequences won’t make sense as HTML.
- #to_s ⇒ String (also: #to_str) private
Constructor Details
#initialize(attributes = {}) ⇒ Vedeu::Models::Escape
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 a new instance of Vedeu::Models::Escape.
22 23 24 25 26 |
# File 'lib/vedeu/models/escape.rb', line 22 def initialize(attributes = {}) defaults.merge!(attributes).each do |key, value| instance_variable_set("@#{key}", value) end end |
Instance Attribute Details
#value ⇒ 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.
13 14 15 |
# File 'lib/vedeu/models/escape.rb', line 13 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.
29 30 31 |
# File 'lib/vedeu/models/escape.rb', line 29 def cell? false end |
#defaults ⇒ Hash (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.
82 83 84 85 86 87 |
# File 'lib/vedeu/models/escape.rb', line 82 def defaults { position: [1, 1], value: '', } 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.
46 47 48 |
# File 'lib/vedeu/models/escape.rb', line 46 def eql?(other) self.class == other.class && value == other.value end |
#null ⇒ NilClass Also known as: background, colour, foreground, style
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.
34 35 36 |
# File 'lib/vedeu/models/escape.rb', line 34 def null nil end |
#position ⇒ 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.
52 53 54 |
# File 'lib/vedeu/models/escape.rb', line 52 def position Vedeu::Geometry::Position.coerce(@position) end |
#to_hash ⇒ Hash<void>
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.
Return an empty hash as most escape sequences won’t make sense as JSON.
60 61 62 |
# File 'lib/vedeu/models/escape.rb', line 60 def to_hash {} 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.
Return an empty string as most escape sequences won’t make sense as HTML.
69 70 71 |
# File 'lib/vedeu/models/escape.rb', line 69 def to_html( = {}) ''.freeze end |
#to_s ⇒ String Also known as: to_str
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.
74 75 76 |
# File 'lib/vedeu/models/escape.rb', line 74 def to_s "#{position}#{value}".freeze end |