Class: Fontist::WindowsImportSource

Inherits:
ImportSource
  • Object
show all
Defined in:
lib/fontist/windows_import_source.rb

Overview

Import source for Windows Features on Demand (FOD) supplementary fonts

Tracks the capability name and minimum Windows version for fonts installed via Add-WindowsCapability.

Instance Method Summary collapse

Instance Method Details

#==(other) ⇒ Boolean Also known as: eql?

Equality check based on capability name

Parameters:

  • other (Object)

    The object to compare

Returns:

  • (Boolean)

    true if objects are equal



46
47
48
49
50
# File 'lib/fontist/windows_import_source.rb', line 46

def ==(other)
  return false unless other.is_a?(WindowsImportSource)

  capability_name == other.capability_name
end

#differentiation_keyString?

Returns the capability name for differentiation

Returns:

  • (String, nil)

    Capability name or nil



18
19
20
# File 'lib/fontist/windows_import_source.rb', line 18

def differentiation_key
  capability_name
end

#outdated?(new_source) ⇒ Boolean

Checks if this import source is older than the provided new source

Parameters:

Returns:

  • (Boolean)

    true if this source is outdated



26
27
28
29
30
31
32
# File 'lib/fontist/windows_import_source.rb', line 26

def outdated?(new_source)
  return false unless new_source.is_a?(WindowsImportSource)

  # Windows FOD capabilities don't have versioned updates in the same way;
  # they are either present or not. Always return false.
  false
end

#to_sString

Returns a human-readable string representation

Returns:

  • (String)

    String representation for debugging/logging



37
38
39
40
# File 'lib/fontist/windows_import_source.rb', line 37

def to_s
  "Windows FOD (capability: #{capability_name}, " \
    "min_version: #{min_windows_version})"
end