Class: Sablon::Content::WordML

Inherits:
Struct
  • Object
show all
Includes:
Sablon::Content
Defined in:
lib/sablon/content.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Sablon::Content

make, register, remove, wrap

Instance Attribute Details

#xmlObject

Returns the value of attribute xml

Returns:

  • (Object)

    the current value of xml



67
68
69
# File 'lib/sablon/content.rb', line 67

def xml
  @xml
end

Class Method Details

.idObject



69
# File 'lib/sablon/content.rb', line 69

def self.id; :word_ml end

.wraps?(value) ⇒ Boolean

Returns:

  • (Boolean)


70
# File 'lib/sablon/content.rb', line 70

def self.wraps?(value) false end

Instance Method Details

#append_to(paragraph, display_node) ⇒ Object



72
73
74
75
76
77
# File 'lib/sablon/content.rb', line 72

def append_to(paragraph, display_node)
  Nokogiri::XML.fragment(xml).children.reverse.each do |child|
    paragraph.add_next_sibling child
  end
  paragraph.remove
end