Class: Prismic::Fragments::StructuredText::Block::Embed

Inherits:
Prismic::Fragments::StructuredText::Block show all
Defined in:
lib/prismic/fragments/structured_text.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Prismic::Fragments::StructuredText::Block

#as_text

Constructor Details

#initialize(embed, label) ⇒ Embed

Returns a new instance of Embed



375
376
377
378
# File 'lib/prismic/fragments/structured_text.rb', line 375

def initialize(embed, label)
  @embed = embed
  @label = label
end

Instance Attribute Details

#labelObject

Returns the value of attribute label



373
374
375
# File 'lib/prismic/fragments/structured_text.rb', line 373

def label
  @label
end

Instance Method Details

#as_html(link_resolver, html_serializer = nil) ⇒ Object



380
381
382
383
384
385
386
387
388
389
390
# File 'lib/prismic/fragments/structured_text.rb', line 380

def as_html(link_resolver, html_serializer = nil)
  custom = nil
  unless html_serializer.nil?
    custom = html_serializer.serialize(self, '')
  end
  if custom.nil?
    embed.as_html(link_resolver)
  else
    custom
  end
end