Class: EmbeddableContent::EmbeddedTags
- Inherits:
-
Object
- Object
- EmbeddableContent::EmbeddedTags
- Defined in:
- app/services/embeddable_content/embedded_tags.rb
Instance Attribute Summary collapse
-
#attr ⇒ Object
readonly
Returns the value of attribute attr.
-
#embedded_models ⇒ Object
readonly
Returns the value of attribute embedded_models.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(record, attr, embedded_models) ⇒ EmbeddedTags
constructor
A new instance of EmbeddedTags.
Constructor Details
#initialize(record, attr, embedded_models) ⇒ EmbeddedTags
Returns a new instance of EmbeddedTags.
5 6 7 8 9 |
# File 'app/services/embeddable_content/embedded_tags.rb', line 5 def initialize(record, attr, ) @record = record @attr = attr @embedded_models = end |
Instance Attribute Details
#attr ⇒ Object (readonly)
Returns the value of attribute attr.
3 4 5 |
# File 'app/services/embeddable_content/embedded_tags.rb', line 3 def attr @attr end |
#embedded_models ⇒ Object (readonly)
Returns the value of attribute embedded_models.
3 4 5 |
# File 'app/services/embeddable_content/embedded_tags.rb', line 3 def @embedded_models end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
3 4 5 |
# File 'app/services/embeddable_content/embedded_tags.rb', line 3 def record @record end |
Instance Method Details
#each ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'app/services/embeddable_content/embedded_tags.rb', line 11 def each .each do |model| document.css(model.).each do |dom_node| info = EmbeddedTagInfo.new record, model, attr, dom_node yield info if info.available? end end end |