Class: EmbeddableContent::EmbeddedTagInfo

Inherits:
Object
  • Object
show all
Defined in:
app/services/embeddable_content/embedded_tag_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record, embedded_model, attr, dom_node) ⇒ EmbeddedTagInfo

Returns a new instance of EmbeddedTagInfo.



5
6
7
8
9
10
# File 'app/services/embeddable_content/embedded_tag_info.rb', line 5

def initialize(record, embedded_model, attr, dom_node)
  @record         = record
  @embedded_model = embedded_model
  @attr           = attr
  @dom_node       = dom_node
end

Instance Attribute Details

#attrObject (readonly)

Returns the value of attribute attr.



3
4
5
# File 'app/services/embeddable_content/embedded_tag_info.rb', line 3

def attr
  @attr
end

#dom_nodeObject (readonly)

Returns the value of attribute dom_node.



3
4
5
# File 'app/services/embeddable_content/embedded_tag_info.rb', line 3

def dom_node
  @dom_node
end

#embedded_modelObject (readonly)

Returns the value of attribute embedded_model.



3
4
5
# File 'app/services/embeddable_content/embedded_tag_info.rb', line 3

def embedded_model
  @embedded_model
end

#recordObject (readonly)

Returns the value of attribute record.



3
4
5
# File 'app/services/embeddable_content/embedded_tag_info.rb', line 3

def record
  @record
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'app/services/embeddable_content/embedded_tag_info.rb', line 12

def available?
  match.present?
end

#embedded_recordObject



24
25
26
# File 'app/services/embeddable_content/embedded_tag_info.rb', line 24

def embedded_record
  @embedded_record ||= embedded_model.find embedded_record_id
end

#embedded_record_extObject



20
21
22
# File 'app/services/embeddable_content/embedded_tag_info.rb', line 20

def embedded_record_ext
  match.try :last
end

#embedded_record_idObject



16
17
18
# File 'app/services/embeddable_content/embedded_tag_info.rb', line 16

def embedded_record_id
  match.try :first
end