Class: Xembly::Set

Inherits:
Object
  • Object
show all
Defined in:
lib/xembly/set.rb

Overview

SET directive

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Set

Ctor.

value

Text value to set



32
33
34
# File 'lib/xembly/set.rb', line 32

def initialize(value)
  @value = value
end

Instance Method Details

#exec(_, cursor) ⇒ Object



36
37
38
39
40
41
42
# File 'lib/xembly/set.rb', line 36

def exec(_, cursor)
  cursor.each do |node|
    node.content = Nokogiri::HTML.parse(@value).text
    Xembly.log.info "node \"#{node.name}\" text content set"
  end
  cursor
end