Class: Seo::FaInlineSvgRestorer::Result

Inherits:
Data
  • Object
show all
Defined in:
app/services/seo/fa_inline_svg_restorer.rb

Overview

Result of a #process call.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#changedBoolean (readonly) Also known as: changed?

Returns whether any replacement occurred (also exposed as changed?).

Returns:

  • (Boolean)

    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_outString? (readonly)

Returns the rewritten html_safe HTML, or nil when no replacements were made.

Returns:

  • (String, nil)

    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_countInteger (readonly)

Returns number of missing callout-facts icons restored.

Returns:

  • (Integer)

    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_countInteger (readonly)

Returns number of SVGs replaced with <i> tags.

Returns:

  • (Integer)

    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