Class: HtmlSurgeon::Change
- Inherits:
-
Object
- Object
- HtmlSurgeon::Change
- Defined in:
- lib/html_surgeon/change.rb
Direct Known Subclasses
HtmlSurgeon::Changes::AddCssClass, HtmlSurgeon::Changes::ReplaceTagName
Constant Summary collapse
- DATA_CHANGE_AUDIT_ATTRIBUTE =
'data-surgeon-audit'.freeze
Instance Attribute Summary collapse
-
#change_set ⇒ Object
readonly
Returns the value of attribute change_set.
Instance Method Summary collapse
- #apply(element) ⇒ Object
-
#initialize(change_set:) ⇒ Change
constructor
A new instance of Change.
- #log ⇒ Object
Constructor Details
#initialize(change_set:) ⇒ Change
Returns a new instance of Change.
8 9 10 |
# File 'lib/html_surgeon/change.rb', line 8 def initialize(change_set:) @change_set = change_set end |
Instance Attribute Details
#change_set ⇒ Object (readonly)
Returns the value of attribute change_set.
6 7 8 |
# File 'lib/html_surgeon/change.rb', line 6 def change_set @change_set end |
Instance Method Details
#apply(element) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/html_surgeon/change.rb', line 15 def apply(element) prepare_audit_change(element) if audit? apply_in element apply_audit_change(element) if audit? self end |
#log ⇒ Object
25 26 27 |
# File 'lib/html_surgeon/change.rb', line 25 def log raise AbstractMethodError, "a lazy developer has not implemented this method in #{self.class}" end |