class DJNML::Modification::XMLText

Attributes

html[R]
text[R]

Public Class Methods

new(data) click to toggle source
# File lib/djnml/modification.rb, line 94
def initialize(data)
  if data.is_a?(Nokogiri::XML::Element)
    @text = data.children.text.strip
    @html = data.children.to_xml
  elsif data.is_a?(Hash)
    @text = data['text']
    @html = data['html']
  end
end

Public Instance Methods

to_s() click to toggle source
# File lib/djnml/modification.rb, line 104
def to_s
  @text.to_s
end