class Fontist::FontPath
Public Class Methods
Public Instance Methods
Source
# File lib/fontist/font_path.rb, line 25 def fontist_font? @path.start_with?(Fontist.fonts_path.to_s) end
Source
# File lib/fontist/font_path.rb, line 17 def formulas @formulas ||= if fontist_font? Indexes::FilenameIndex.from_yaml.load_index_formulas(File.basename(@path)).map(&:name) else [] end end
Source
# File lib/fontist/font_path.rb, line 9 def to_s [].tap do |s| s << "-" s << @path s << "(from #{formulas.join(' or ')} formula)" if formulas.any? end.join(" ") end