Class: Seo::FaInlineSvgRestorer::Result
- Inherits:
-
Data
- Object
- Data
- Seo::FaInlineSvgRestorer::Result
- Defined in:
- app/services/seo/fa_inline_svg_restorer.rb
Overview
Result of a #process call.
Instance Attribute Summary collapse
-
#changed ⇒ Boolean
(also: #changed?)
readonly
Whether any replacement occurred (also exposed as
changed?). -
#html_out ⇒ String?
readonly
The rewritten html_safe HTML, or nil when no replacements were made.
-
#icon_count ⇒ Integer
readonly
Number of missing callout-facts icons restored.
-
#svg_count ⇒ Integer
readonly
Number of SVGs replaced with
<i>tags.
Instance Method Summary collapse
-
#initialize(html_out: nil, changed: false, svg_count: 0, icon_count: 0) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(html_out: nil, changed: false, svg_count: 0, icon_count: 0) ⇒ Result
Returns a new instance of Result.
43 |
# File 'app/services/seo/fa_inline_svg_restorer.rb', line 43 def initialize(html_out: nil, changed: false, svg_count: 0, icon_count: 0) = super |
Instance Attribute Details
#changed ⇒ Boolean (readonly) Also known as: changed?
Returns whether any replacement occurred (also exposed as changed?).
42 43 44 45 |
# File 'app/services/seo/fa_inline_svg_restorer.rb', line 42 Result = Data.define(:html_out, :changed, :svg_count, :icon_count) do def initialize(html_out: nil, changed: false, svg_count: 0, icon_count: 0) = super alias_method :changed?, :changed end |
#html_out ⇒ String? (readonly)
Returns the rewritten html_safe HTML, or nil when no replacements were made.
42 43 44 45 |
# File 'app/services/seo/fa_inline_svg_restorer.rb', line 42 Result = Data.define(:html_out, :changed, :svg_count, :icon_count) do def initialize(html_out: nil, changed: false, svg_count: 0, icon_count: 0) = super alias_method :changed?, :changed end |
#icon_count ⇒ Integer (readonly)
Returns number of missing callout-facts icons restored.
42 43 44 45 |
# File 'app/services/seo/fa_inline_svg_restorer.rb', line 42 Result = Data.define(:html_out, :changed, :svg_count, :icon_count) do def initialize(html_out: nil, changed: false, svg_count: 0, icon_count: 0) = super alias_method :changed?, :changed end |
#svg_count ⇒ Integer (readonly)
Returns number of SVGs replaced with <i> tags.
42 43 44 45 |
# File 'app/services/seo/fa_inline_svg_restorer.rb', line 42 Result = Data.define(:html_out, :changed, :svg_count, :icon_count) do def initialize(html_out: nil, changed: false, svg_count: 0, icon_count: 0) = super alias_method :changed?, :changed end |