Class: Prismic::Fragments::Embed
- Inherits:
-
Fragment
- Object
- Fragment
- Prismic::Fragments::Embed
- Defined in:
- lib/prismic/fragments/embed.rb
Instance Attribute Summary (collapse)
-
- (Object) embed_type
Returns the value of attribute embed_type.
-
- (Object) html
Returns the value of attribute html.
-
- (Object) o_embed_json
Returns the value of attribute o_embed_json.
-
- (Object) provider
Returns the value of attribute provider.
-
- (Object) url
Returns the value of attribute url.
Instance Method Summary (collapse)
-
- (String) as_html(link_resolver = nil, html_serializer = nil)
Generate an HTML representation of the fragment.
-
- (Embed) initialize(embed_type, provider, url, html, o_embed_json)
constructor
A new instance of Embed.
Methods inherited from Fragment
Constructor Details
- (Embed) initialize(embed_type, provider, url, html, o_embed_json)
Returns a new instance of Embed
7 8 9 10 11 12 13 |
# File 'lib/prismic/fragments/embed.rb', line 7 def initialize(, provider, url, html, ) @embed_type = @provider = provider @url = url @html = html @o_embed_json = end |
Instance Attribute Details
- (Object) embed_type
Returns the value of attribute embed_type
5 6 7 |
# File 'lib/prismic/fragments/embed.rb', line 5 def @embed_type end |
- (Object) html
Returns the value of attribute html
5 6 7 |
# File 'lib/prismic/fragments/embed.rb', line 5 def html @html end |
- (Object) o_embed_json
Returns the value of attribute o_embed_json
5 6 7 |
# File 'lib/prismic/fragments/embed.rb', line 5 def @o_embed_json end |
- (Object) provider
Returns the value of attribute provider
5 6 7 |
# File 'lib/prismic/fragments/embed.rb', line 5 def provider @provider end |
- (Object) url
Returns the value of attribute url
5 6 7 |
# File 'lib/prismic/fragments/embed.rb', line 5 def url @url end |
Instance Method Details
- (String) as_html(link_resolver = nil, html_serializer = nil)
Generate an HTML representation of the fragment
21 22 23 |
# File 'lib/prismic/fragments/embed.rb', line 21 def as_html(link_resolver=nil, html_serializer=nil) %Q|<div data-oembed="#{@url}" data-oembed-type="#{@embed_type.downcase}" data-oembed-provider="#{@provider.downcase}">#@html</div>| end |