Class: PwaManifestGenerator::Intent
- Inherits:
-
Object
- Object
- PwaManifestGenerator::Intent
- Includes:
- Freezeable
- Defined in:
- lib/pwa_manifest_generator/intent.rb
Instance Attribute Summary collapse
-
#filters ⇒ Object
readonly
Returns the value of attribute filters.
Instance Method Summary collapse
-
#initialize(filters = []) ⇒ Intent
constructor
A new instance of Intent.
- #to_html ⇒ Object
- #valid? ⇒ Boolean
Methods included from Freezeable
Constructor Details
Instance Attribute Details
#filters ⇒ Object (readonly)
Returns the value of attribute filters.
12 13 14 |
# File 'lib/pwa_manifest_generator/intent.rb', line 12 def filters @filters end |
Instance Method Details
#to_html ⇒ Object
25 26 27 28 |
# File 'lib/pwa_manifest_generator/intent.rb', line 25 def to_html html = @filters.to_html html.respond_to?(:html_safe) ? html.html_safe : html end |
#valid? ⇒ Boolean
18 19 20 21 22 23 |
# File 'lib/pwa_manifest_generator/intent.rb', line 18 def valid? @filters.all? do |filter| filter.is_a?(Hash) && filter.key?(:scope_url_scheme) && filter.key?(:scope_url_host) && filter.key?(:scope_url_path) end end |