Class: Fontist::FontInstaller
- Inherits:
-
Object
- Object
- Fontist::FontInstaller
- Defined in:
- lib/fontist/font_installer.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
-
#initialize(formula, font_name: nil, no_progress: false, location: nil) ⇒ FontInstaller
constructor
A new instance of FontInstaller.
- #install(confirmation:) ⇒ Object
Constructor Details
#initialize(formula, font_name: nil, no_progress: false, location: nil) ⇒ FontInstaller
Returns a new instance of FontInstaller.
12 13 14 15 16 17 |
# File 'lib/fontist/font_installer.rb', line 12 def initialize(formula, font_name: nil, no_progress: false, location: nil) @formula = formula @font_name = font_name @no_progress = no_progress @location = InstallLocation.create(formula, location_type: location) end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
10 11 12 |
# File 'lib/fontist/font_installer.rb', line 10 def location @location end |
Instance Method Details
#install(confirmation:) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/fontist/font_installer.rb', line 19 def install(confirmation:) raise_platform_error unless platform_compatible? raise_fontist_version_error unless supported_version? raise_licensing_error unless license_is_accepted?(confirmation) install_font end |