Class: Sablon::Content::HTML

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

Overview

Handles conversion of HTML -> WordML and addition into template

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Sablon::Content

make, register, remove, wrap

Constructor Details

#initialize(value) ⇒ HTML

Returns a new instance of HTML.



169
170
171
# File 'lib/sablon/content.rb', line 169

def initialize(value)
  super value
end

Instance Attribute Details

#html_contentObject

Returns the value of attribute html_content

Returns:

  • (Object)

    the current value of html_content



164
165
166
# File 'lib/sablon/content.rb', line 164

def html_content
  @html_content
end

Class Method Details

.idObject



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

def self.id; :html end

.wraps?(value) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.wraps?(value) false end

Instance Method Details

#append_to(paragraph, display_node, env) ⇒ Object



173
174
175
176
177
# File 'lib/sablon/content.rb', line 173

def append_to(paragraph, display_node, env)
  converter = HTMLConverter.new
  word_ml = WordML.new(converter.process(html_content, env))
  word_ml.append_to(paragraph, display_node, env)
end