Class: Uniword::WordImplementation
- Inherits:
-
Object
- Object
- Uniword::WordImplementation
- Defined in:
- lib/uniword/word_implementation.rb
Overview
Abstract base class for Word implementation queries
This is a MODEL (not just a service). It has:
-
State: platform, version, installation status
-
Behavior: query paths, list resources
Does NOT extend Lutaml::Model::Serializable because it doesn’t need serialization.
Direct Known Subclasses
LinuxWordImplementation, MacOSWordImplementation, NullWordImplementation, WindowsWordImplementation
Class Method Summary collapse
-
.detect ⇒ Object
Factory - delegates to platform-specific implementation.
Instance Method Summary collapse
- #available_color_schemes ⇒ Object
- #available_font_schemes ⇒ Object
- #available_stylesets ⇒ Object
-
#available_themes ⇒ Object
Resource enumeration - return empty array by default.
- #cache_path ⇒ Object
- #color_schemes_path ⇒ Object
- #font_schemes_path ⇒ Object
-
#installed? ⇒ Boolean
Abstract methods - raise if not overridden.
- #stylesets_path ⇒ Object
-
#themes_path ⇒ Object
Path accessors - return nil if not applicable.
- #version ⇒ Object
Class Method Details
.detect ⇒ Object
Factory - delegates to platform-specific implementation
13 14 15 |
# File 'lib/uniword/word_implementation.rb', line 13 def self.detect WordImplementationFactory.create end |
Instance Method Details
#available_color_schemes ⇒ Object
50 51 52 53 54 55 56 |
# File 'lib/uniword/word_implementation.rb', line 50 def available_color_schemes return [] unless color_schemes_path && File.directory?(color_schemes_path) Dir.glob(File.join(color_schemes_path, "*.xml")).map do |f| File.basename(f, ".xml") end end |
#available_font_schemes ⇒ Object
58 59 60 61 62 63 64 |
# File 'lib/uniword/word_implementation.rb', line 58 def available_font_schemes return [] unless font_schemes_path && File.directory?(font_schemes_path) Dir.glob(File.join(font_schemes_path, "*.xml")).map do |f| File.basename(f, ".xml") end end |
#available_stylesets ⇒ Object
42 43 44 45 46 47 48 |
# File 'lib/uniword/word_implementation.rb', line 42 def available_stylesets return [] unless stylesets_path && File.directory?(stylesets_path) Dir.glob(File.join(stylesets_path, "*.dotx")).map do |f| File.basename(f, ".dotx") end end |
#available_themes ⇒ Object
Resource enumeration - return empty array by default
34 35 36 37 38 39 40 |
# File 'lib/uniword/word_implementation.rb', line 34 def available_themes return [] unless themes_path && File.directory?(themes_path) Dir.glob(File.join(themes_path, "*.thmx")).map do |f| File.basename(f, ".thmx") end end |
#cache_path ⇒ Object
31 |
# File 'lib/uniword/word_implementation.rb', line 31 def cache_path; end |
#color_schemes_path ⇒ Object
29 |
# File 'lib/uniword/word_implementation.rb', line 29 def color_schemes_path; end |
#font_schemes_path ⇒ Object
30 |
# File 'lib/uniword/word_implementation.rb', line 30 def font_schemes_path; end |
#installed? ⇒ Boolean
Abstract methods - raise if not overridden
18 19 20 |
# File 'lib/uniword/word_implementation.rb', line 18 def installed? raise NotImplementedError end |
#stylesets_path ⇒ Object
28 |
# File 'lib/uniword/word_implementation.rb', line 28 def stylesets_path; end |
#themes_path ⇒ Object
Path accessors - return nil if not applicable
27 |
# File 'lib/uniword/word_implementation.rb', line 27 def themes_path; end |
#version ⇒ Object
22 23 24 |
# File 'lib/uniword/word_implementation.rb', line 22 def version raise NotImplementedError end |