Class: Caracal::Core::Models::TextModel
- Defined in:
- lib/caracal/core/models/text_model.rb
Overview
This class encapsulates the logic needed to store and manipulate text data.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#text_bgcolor ⇒ Object
readonly
Returns the value of attribute text_bgcolor.
-
#text_bold ⇒ Object
readonly
Returns the value of attribute text_bold.
-
#text_color ⇒ Object
readonly
Returns the value of attribute text_color.
-
#text_content ⇒ Object
readonly
accessors.
-
#text_font ⇒ Object
readonly
Returns the value of attribute text_font.
-
#text_italic ⇒ Object
readonly
Returns the value of attribute text_italic.
-
#text_size ⇒ Object
readonly
Returns the value of attribute text_size.
-
#text_underline ⇒ Object
readonly
Returns the value of attribute text_underline.
Instance Method Summary collapse
-
#run_attributes ⇒ Object
.run_attributes.
-
#valid? ⇒ Boolean
VALIDATION ===========================.
Methods inherited from BaseModel
Constructor Details
This class inherits a constructor from Caracal::Core::Models::BaseModel
Instance Attribute Details
#text_bgcolor ⇒ Object (readonly)
Returns the value of attribute text_bgcolor.
25 26 27 |
# File 'lib/caracal/core/models/text_model.rb', line 25 def text_bgcolor @text_bgcolor end |
#text_bold ⇒ Object (readonly)
Returns the value of attribute text_bold.
22 23 24 |
# File 'lib/caracal/core/models/text_model.rb', line 22 def text_bold @text_bold end |
#text_color ⇒ Object (readonly)
Returns the value of attribute text_color.
20 21 22 |
# File 'lib/caracal/core/models/text_model.rb', line 20 def text_color @text_color end |
#text_content ⇒ Object (readonly)
accessors
18 19 20 |
# File 'lib/caracal/core/models/text_model.rb', line 18 def text_content @text_content end |
#text_font ⇒ Object (readonly)
Returns the value of attribute text_font.
19 20 21 |
# File 'lib/caracal/core/models/text_model.rb', line 19 def text_font @text_font end |
#text_italic ⇒ Object (readonly)
Returns the value of attribute text_italic.
23 24 25 |
# File 'lib/caracal/core/models/text_model.rb', line 23 def text_italic @text_italic end |
#text_size ⇒ Object (readonly)
Returns the value of attribute text_size.
21 22 23 |
# File 'lib/caracal/core/models/text_model.rb', line 21 def text_size @text_size end |
#text_underline ⇒ Object (readonly)
Returns the value of attribute text_underline.
24 25 26 |
# File 'lib/caracal/core/models/text_model.rb', line 24 def text_underline @text_underline end |
Instance Method Details
#run_attributes ⇒ Object
.run_attributes
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/caracal/core/models/text_model.rb', line 36 def run_attributes { font: text_font, color: text_color, size: text_size, bold: text_bold, italic: text_italic, underline: text_underline, bgcolor: text_bgcolor } end |
#valid? ⇒ Boolean
VALIDATION ===========================
75 76 77 78 |
# File 'lib/caracal/core/models/text_model.rb', line 75 def valid? a = [:content] a.map { |m| send("text_#{ m }") }.compact.size == a.size end |