Class: Deface::Actions::Replace

Inherits:
ElementAction show all
Defined in:
lib/deface/actions/replace.rb

Instance Attribute Summary

Attributes inherited from ElementAction

#source_element

Instance Method Summary collapse

Methods inherited from ElementAction

#initialize

Methods inherited from Action

#initialize, to_sym

Constructor Details

This class inherits a constructor from Deface::Actions::ElementAction

Instance Method Details

#execute(target_range) ⇒ Object



4
5
6
7
# File 'lib/deface/actions/replace.rb', line 4

def execute(target_range)
  target_range.first.before(source_element)
  target_range.map(&:remove)
end

#range_compatible?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/deface/actions/replace.rb', line 9

def range_compatible?
  true
end