Class: EmbeddableContent::Embedder
- Inherits:
-
EmbedderBase
- Object
- EmbedderBase
- EmbeddableContent::Embedder
- Defined in:
- app/services/embeddable_content/embedder.rb
Constant Summary collapse
- NO_REPLACEMENTS_BY_DEFAULT =
{}.freeze
Instance Attribute Summary collapse
-
#document ⇒ Object
readonly
Returns the value of attribute document.
-
#html ⇒ Object
readonly
Returns the value of attribute html.
Attributes inherited from EmbedderBase
Instance Method Summary collapse
- #embed_content!(content) ⇒ Object
- #image_catalog ⇒ Object
-
#initialize(target, options = {}) ⇒ Embedder
constructor
A new instance of Embedder.
- #rebuild_document ⇒ Object
Methods inherited from EmbedderBase
default_s3_bucket, #ed_node, #locale, #s3_bucket, #target, #to_s, #tree, #tree_node
Constructor Details
#initialize(target, options = {}) ⇒ Embedder
Returns a new instance of Embedder.
7 8 9 |
# File 'app/services/embeddable_content/embedder.rb', line 7 def initialize(target, = {}) super EmbedderConfig.for_target(target), end |
Instance Attribute Details
#document ⇒ Object (readonly)
Returns the value of attribute document.
5 6 7 |
# File 'app/services/embeddable_content/embedder.rb', line 5 def document @document end |
#html ⇒ Object (readonly)
Returns the value of attribute html.
5 6 7 |
# File 'app/services/embeddable_content/embedder.rb', line 5 def html @html end |
Instance Method Details
#embed_content!(content) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/services/embeddable_content/embedder.rb', line 15 def (content) @html = content.to_str.dup @document = scrub parse_html perform_replacements run_doc_processors if @html end |
#image_catalog ⇒ Object
11 12 13 |
# File 'app/services/embeddable_content/embedder.rb', line 11 def image_catalog @image_catalog ||= Set.new end |
#rebuild_document ⇒ Object
24 25 26 |
# File 'app/services/embeddable_content/embedder.rb', line 24 def rebuild_document @document = parse_html end |