Sha256: 2377ba81e051901c3e2413cb0981f1410425330ac4e8e3edf098c1e15e598b3f

Contents?: true

Size: 1.15 KB

Versions: 33

Compression:

Stored size: 1.15 KB

Contents

module Fontist
  module Utils
    module Dsl
      class CollectionFont
        REQUIRED_ATTRIBUTES = %i[style].freeze

        attr_reader :attributes

        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

        def attributes=(attrs)
          @attributes = { family_name: attrs[:family_name],
                          type: attrs[:style],
                          collection: attrs[:full_name],
                          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
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
fontist-1.13.2 lib/fontist/utils/dsl/collection_font.rb
fontist-1.13.1 lib/fontist/utils/dsl/collection_font.rb
fontist-1.13.0 lib/fontist/utils/dsl/collection_font.rb
fontist-1.12.0 lib/fontist/utils/dsl/collection_font.rb
fontist-1.11.7 lib/fontist/utils/dsl/collection_font.rb
fontist-1.11.6 lib/fontist/utils/dsl/collection_font.rb
fontist-1.11.5 lib/fontist/utils/dsl/collection_font.rb
fontist-1.11.3 lib/fontist/utils/dsl/collection_font.rb
fontist-1.11.2 lib/fontist/utils/dsl/collection_font.rb
fontist-1.9.3 lib/fontist/utils/dsl/collection_font.rb
fontist-1.9.2 lib/fontist/utils/dsl/collection_font.rb
fontist-1.11.1 lib/fontist/utils/dsl/collection_font.rb
fontist-1.10.1 lib/fontist/utils/dsl/collection_font.rb
fontist-1.10.0 lib/fontist/utils/dsl/collection_font.rb
fontist-1.9.1 lib/fontist/utils/dsl/collection_font.rb
fontist-1.9.0 lib/fontist/utils/dsl/collection_font.rb
fontist-1.8.13 lib/fontist/utils/dsl/collection_font.rb
fontist-1.8.12 lib/fontist/utils/dsl/collection_font.rb
fontist-1.8.11 lib/fontist/utils/dsl/collection_font.rb
fontist-1.8.10 lib/fontist/utils/dsl/collection_font.rb