class Fontist::Utils::Dsl::Font

Constants

REQUIRED_ATTRIBUTES

Attributes

attributes[R]

Public Class Methods

new(attributes) click to toggle source
# 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

Public Instance Methods

attributes=(attrs) click to toggle source
# File lib/fontist/utils/dsl/font.rb, line 24
def attributes=(attrs)
  @attributes = { family_name: attrs[:family_name],
                  type: attrs[:style],
                  full_name: attrs[:full_name],
                  post_script_name: attrs[:post_script_name],
                  version: attrs[:version],
                  description: attrs[:description],
                  copyright: attrs[:copyright],
                  font: attrs[:filename],
                  source_font: attrs[:source_filename] }
end