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.



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

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



159
160
161
# File 'lib/sablon/content.rb', line 159

def html_content
  @html_content
end

Class Method Details

.idObject



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

def self.id; :html end

.wraps?(value) ⇒ Boolean

Returns:

  • (Boolean)


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

def self.wraps?(value) false end

Instance Method Details

#append_to(paragraph, display_node, env) ⇒ Object



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

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