Class: EmbeddableContent::NodeProcessor
- Inherits:
-
EmbedderBase
- Object
- EmbedderBase
- EmbeddableContent::NodeProcessor
- Defined in:
- app/services/embeddable_content/node_processor.rb
Direct Known Subclasses
Constant Summary collapse
- NODE_CAN_BE_REMOVED_BY_DEFAULT =
true- SELECTOR_CLASS_BLANK_BY_DEFAULT =
nil- RECORD_BLANK_BY_DEFAULT =
nil- ALL_TARGETS_PROCESSED_BY_DEFAULT =
EmbedderConfig::ALL_TARGETS
- DEFAULT_TEMPLATE_MANAGER_CLASS =
TemplateManager- ADDED_CLASSES_BLANK_BY_DEFAULT =
[].freeze
Instance Attribute Summary collapse
-
#doc_processor ⇒ Object
readonly
Returns the value of attribute doc_processor.
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#node_index ⇒ Object
readonly
Returns the value of attribute node_index.
Attributes inherited from EmbedderBase
Instance Method Summary collapse
-
#initialize(doc_processor, node, node_index) ⇒ NodeProcessor
constructor
A new instance of NodeProcessor.
- #node_added_classes ⇒ Object
- #node_selector_class ⇒ Object
- #process! ⇒ Object
- #record ⇒ Object
Methods inherited from EmbedderBase
default_s3_bucket, #ed_node, #locale, #s3_bucket, #target, #to_s, #tree, #tree_node
Constructor Details
#initialize(doc_processor, node, node_index) ⇒ NodeProcessor
Returns a new instance of NodeProcessor.
15 16 17 18 19 20 |
# File 'app/services/embeddable_content/node_processor.rb', line 15 def initialize(doc_processor, node, node_index) @doc_processor = doc_processor @node = node @node_index = node_index super .config, . end |
Instance Attribute Details
#doc_processor ⇒ Object (readonly)
Returns the value of attribute doc_processor.
10 11 12 |
# File 'app/services/embeddable_content/node_processor.rb', line 10 def doc_processor @doc_processor end |
#error ⇒ Object (readonly)
Returns the value of attribute error.
10 11 12 |
# File 'app/services/embeddable_content/node_processor.rb', line 10 def error @error end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
10 11 12 |
# File 'app/services/embeddable_content/node_processor.rb', line 10 def node @node end |
#node_index ⇒ Object (readonly)
Returns the value of attribute node_index.
10 11 12 |
# File 'app/services/embeddable_content/node_processor.rb', line 10 def node_index @node_index end |
Instance Method Details
#node_added_classes ⇒ Object
33 34 35 |
# File 'app/services/embeddable_content/node_processor.rb', line 33 def node_added_classes ADDED_CLASSES_BLANK_BY_DEFAULT end |
#node_selector_class ⇒ Object
29 30 31 |
# File 'app/services/embeddable_content/node_processor.rb', line 29 def node_selector_class SELECTOR_CLASS_BLANK_BY_DEFAULT end |
#process! ⇒ Object
22 23 24 25 26 27 |
# File 'app/services/embeddable_content/node_processor.rb', line 22 def process! process_node || remove_node rescue StandardError => e @error = e node.replace warning_node end |
#record ⇒ Object
37 38 39 |
# File 'app/services/embeddable_content/node_processor.rb', line 37 def record RECORD_BLANK_BY_DEFAULT end |