Class: Fontist::SilImportSource
- Inherits:
-
ImportSource
- Object
- Lutaml::Model::Serializable
- ImportSource
- Fontist::SilImportSource
- Defined in:
- lib/fontist/sil_import_source.rb
Overview
Import source for SIL International fonts
Tracks version and release information for fonts imported from SIL.
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
(also: #eql?)
Equality check based on differentiation key.
-
#differentiation_key ⇒ String?
Returns the version as the differentiation key.
-
#outdated?(new_source) ⇒ Boolean
Checks if this import source is older than the provided new source.
-
#to_s ⇒ String
Returns a human-readable string representation.
Instance Method Details
#==(other) ⇒ Boolean Also known as: eql?
Equality check based on differentiation key
47 48 49 50 51 |
# File 'lib/fontist/sil_import_source.rb', line 47 def ==(other) return false unless other.is_a?(SilImportSource) version == other.version end |
#differentiation_key ⇒ String?
Returns the version as the differentiation key
17 18 19 |
# File 'lib/fontist/sil_import_source.rb', line 17 def differentiation_key version end |
#outdated?(new_source) ⇒ Boolean
Checks if this import source is older than the provided new source
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/fontist/sil_import_source.rb', line 25 def outdated?(new_source) return false unless new_source.is_a?(SilImportSource) return false unless version && new_source.version # Compare versions lexicographically (assumes semantic versioning) version < new_source.version rescue StandardError => e Fontist.ui.error("Error comparing SIL import sources: #{e.}") false end |
#to_s ⇒ String
Returns a human-readable string representation
39 40 41 |
# File 'lib/fontist/sil_import_source.rb', line 39 def to_s "SIL Fonts (version: #{version}, released: #{release_date})" end |