Class: Caracal::Core::Models::FontModel
- Defined in:
- lib/caracal/core/models/font_model.rb
Overview
This class encapsulates the logic needed to store and manipulate font data.
Instance Attribute Summary collapse
-
#font_name ⇒ Object
readonly
accessors.
Instance Method Summary collapse
-
#matches?(str) ⇒ Boolean
STATE ================================.
-
#valid? ⇒ Boolean
VALIDATION ===========================.
Methods inherited from BaseModel
Constructor Details
This class inherits a constructor from Caracal::Core::Models::BaseModel
Instance Attribute Details
#font_name ⇒ Object (readonly)
accessors
18 19 20 |
# File 'lib/caracal/core/models/font_model.rb', line 18 def font_name @font_name end |
Instance Method Details
#matches?(str) ⇒ Boolean
STATE ================================
38 39 40 |
# File 'lib/caracal/core/models/font_model.rb', line 38 def matches?(str) font_name.to_s.downcase == str.to_s.downcase end |
#valid? ⇒ Boolean
VALIDATION ===========================
45 46 47 48 |
# File 'lib/caracal/core/models/font_model.rb', line 45 def valid? a = [:name] a.map { |m| send("font_#{ m }") }.compact.size == a.size end |