Class: HtmlSurgeon::Changes::AddCssClass

Inherits:
HtmlSurgeon::Change show all
Defined in:
lib/html_surgeon/changes/add_css_class.rb

Defined Under Namespace

Modules: ChangeSetMethods

Constant Summary collapse

AUDIT_TYPE =
:add_css_class
CLASS_ATTRIBUTE =
'class'.freeze
CLASS_SEPARATOR =
' '.freeze
CLASS_XPATH =
'.//@class'

Instance Attribute Summary collapse

Attributes inherited from HtmlSurgeon::Change

#change_set

Instance Method Summary collapse

Methods inherited from HtmlSurgeon::Change

#apply, #auditor_class, inherited

Constructor Details

#initialize(css_class:, **other) ⇒ AddCssClass

Returns a new instance of AddCssClass.



12
13
14
15
16
# File 'lib/html_surgeon/changes/add_css_class.rb', line 12

def initialize(css_class:, **other)
  @css_class = css_class

  super **other
end

Instance Attribute Details

#css_classObject (readonly)

Returns the value of attribute css_class.



10
11
12
# File 'lib/html_surgeon/changes/add_css_class.rb', line 10

def css_class
  @css_class
end

Instance Method Details

#logObject



18
19
20
# File 'lib/html_surgeon/changes/add_css_class.rb', line 18

def log
  "add css class #{css_class}"
end