Class: Fontist::Utils::Dsl::Font
- Inherits:
-
Object
- Object
- Fontist::Utils::Dsl::Font
- Defined in:
- lib/fontist/utils/dsl/font.rb
Constant Summary collapse
- REQUIRED_ATTRIBUTES =
%i[family_name style full_name filename].freeze
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Font
constructor
A new instance of Font.
Constructor Details
#initialize(attributes) ⇒ Font
Returns a new instance of Font.
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/fontist/utils/dsl/font.rb', line 12 def initialize(attributes) REQUIRED_ATTRIBUTES.each do |required_attribute| unless attributes[required_attribute] raise(Fontist::Errors::MissingAttributeError.new( "Missing attribute: #{required_attribute}" )) end end self.attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
10 11 12 |
# File 'lib/fontist/utils/dsl/font.rb', line 10 def attributes @attributes end |