Class: Fontist::Indexes::FormulaKeyToPath
- Inherits:
-
Lutaml::Model::Serializable
- Object
- Lutaml::Model::Serializable
- Fontist::Indexes::FormulaKeyToPath
- Defined in:
- lib/fontist/indexes/formula_key_to_path.rb
Instance Method Summary collapse
Instance Method Details
#name ⇒ Object
16 17 18 |
# File 'lib/fontist/indexes/formula_key_to_path.rb', line 16 def name formula_path.map { |p| normalized(p) } end |
#normalized(path) ⇒ Object
20 21 22 23 24 25 |
# File 'lib/fontist/indexes/formula_key_to_path.rb', line 20 def normalized(path) return "" unless path escaped = Regexp.escape("#{Fontist.formulas_path}/") path.sub(Regexp.new("^#{escaped}"), "").sub(/\.yml$/, "").to_s end |
#to_full ⇒ Object
12 13 14 |
# File 'lib/fontist/indexes/formula_key_to_path.rb', line 12 def to_full formula_path.map { |p| Formula.from_file(full_path(p)) } end |