Class: Y2Packager::LicensesFetchers::Base
- Inherits:
-
Object
- Object
- Y2Packager::LicensesFetchers::Base
- Includes:
- Yast::Logger
- Defined in:
- library/packages/src/lib/y2packager/licenses_fetchers/base.rb
Overview
Base class for licenses fetchers
Constant Summary collapse
- DEFAULT_LANG =
"en_US".freeze
Instance Attribute Summary collapse
-
#product_name ⇒ String
readonly
Product name to get licenses for.
Instance Method Summary collapse
-
#confirmation_required? ⇒ Boolean
Determine whether the license should be accepted or not.
-
#content(lang) ⇒ String?
Return the license content.
-
#found? ⇒ Booelan
Check if this is a valid fecher based on the existence of license content for default language.
-
#initialize(product_name, _options = {}) ⇒ Base
constructor
Constructor.
-
#locales ⇒ Array<String>
Return available language codes for the license of the product.
Constructor Details
#initialize(product_name, _options = {}) ⇒ Base
Constructor
31 32 33 |
# File 'library/packages/src/lib/y2packager/licenses_fetchers/base.rb', line 31 def initialize(product_name, = {}) @product_name = product_name end |
Instance Attribute Details
#product_name ⇒ String (readonly)
Returns Product name to get licenses for.
26 27 28 |
# File 'library/packages/src/lib/y2packager/licenses_fetchers/base.rb', line 26 def product_name @product_name end |
Instance Method Details
#confirmation_required? ⇒ Boolean
Determine whether the license should be accepted or not
66 67 68 |
# File 'library/packages/src/lib/y2packager/licenses_fetchers/base.rb', line 66 def confirmation_required? true end |
#content(lang) ⇒ String?
Return the license content
47 48 49 50 51 52 53 54 |
# File 'library/packages/src/lib/y2packager/licenses_fetchers/base.rb', line 47 def content(lang) # FIXME: not #default_content at some place? if default_lang?(lang) && @default_content return @default_content&.empty? ? nil : @default_content end license_content_for(lang) end |
#found? ⇒ Booelan
Check if this is a valid fecher based on the existence of license content for default language
38 39 40 |
# File 'library/packages/src/lib/y2packager/licenses_fetchers/base.rb', line 38 def found? !default_content.empty? end |
#locales ⇒ Array<String>
Return available language codes for the license of the product
59 60 61 |
# File 'library/packages/src/lib/y2packager/licenses_fetchers/base.rb', line 59 def locales [] end |