Class: Fontist::Info
- Inherits:
-
Object
- Object
- Fontist::Info
- Defined in:
- lib/fontist/repo.rb
Instance Attribute Summary collapse
-
#formulas ⇒ Object
readonly
Returns the value of attribute formulas.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, path) ⇒ Info
constructor
A new instance of Info.
- #to_s ⇒ Object
Constructor Details
#initialize(name, path) ⇒ Info
Returns a new instance of Info.
7 8 9 10 11 |
# File 'lib/fontist/repo.rb', line 7 def initialize(name, path) @name = name @metadata = (path) @formulas = build_formulas(path) end |
Instance Attribute Details
#formulas ⇒ Object (readonly)
Returns the value of attribute formulas.
5 6 7 |
# File 'lib/fontist/repo.rb', line 5 def formulas @formulas end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
5 6 7 |
# File 'lib/fontist/repo.rb', line 5 def @metadata end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/fontist/repo.rb', line 5 def name @name end |
Instance Method Details
#to_s ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/fontist/repo.rb', line 13 def to_s <<~MSG.chomp Repository info for '#{@name}': #{@metadata.map { |k, v| " #{k}: #{v}" }.join("\n")} Found #{formulas.count} formulas: #{@formulas.map { |info| "- #{info.description} (#{info.name})" }.join("\n")} MSG end |