class Fontist::Indexes::PreferredFamilyFontIndex

Public Class Methods

path() click to toggle source
# File lib/fontist/indexes/preferred_family_font_index.rb, line 6
def self.path
  Fontist.formula_preferred_family_index_path
end

Public Instance Methods

add_formula(formula) click to toggle source
# File lib/fontist/indexes/preferred_family_font_index.rb, line 10
def add_formula(formula)
  formula.fonts.each do |font|
    font.styles.each do |style|
      font_name = style.preferred_family_name || font.name
      add_index_formula(font_name, formula.to_index_formula)
    end
  end
end
normalize_key(key) click to toggle source
# File lib/fontist/indexes/preferred_family_font_index.rb, line 19
def normalize_key(key)
  key.downcase
end