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.



377
378
379
380
# File 'lib/prismic/fragments/structured_text.rb', line 377

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

Instance Attribute Details

#embedObject

Returns the value of attribute embed.



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

def embed
  @embed
end

#labelObject

Returns the value of attribute label.



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

def label
  @label
end

Instance Method Details

#as_html(link_resolver, html_serializer = nil) ⇒ Object



398
399
400
401
402
403
404
405
406
407
408
# File 'lib/prismic/fragments/structured_text.rb', line 398

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

#embed_typeObject



382
383
384
# File 'lib/prismic/fragments/structured_text.rb', line 382

def embed_type
  @embed.embed_type
end

#htmlObject



394
395
396
# File 'lib/prismic/fragments/structured_text.rb', line 394

def html
  @embed.html
end

#providerObject



386
387
388
# File 'lib/prismic/fragments/structured_text.rb', line 386

def provider
  @embed.provider
end

#urlObject



390
391
392
# File 'lib/prismic/fragments/structured_text.rb', line 390

def url
  @embed.url
end