Class: Prismic::Fragments::Embed
- Defined in:
 - lib/prismic/fragments/embed.rb
 
Instance Attribute Summary collapse
- 
  
    
      #embed_type  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute embed_type.
 - 
  
    
      #html  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute html.
 - 
  
    
      #o_embed_json  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute o_embed_json.
 - 
  
    
      #provider  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute provider.
 - 
  
    
      #url  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute url.
 
Instance Method Summary collapse
- 
  
    
      #as_html(link_resolver = nil, html_serializer = nil)  ⇒ String 
    
    
  
  
  
  
  
  
  
  
  
    
Generate an HTML representation of the fragment.
 - 
  
    
      #initialize(embed_type, provider, url, html, o_embed_json)  ⇒ Embed 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Embed.
 
Methods inherited from Fragment
Constructor Details
#initialize(embed_type, provider, url, html, o_embed_json) ⇒ Embed
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
#embed_type ⇒ Object
Returns the value of attribute embed_type
      5 6 7  | 
    
      # File 'lib/prismic/fragments/embed.rb', line 5 def @embed_type end  | 
  
#html ⇒ Object
Returns the value of attribute html
      5 6 7  | 
    
      # File 'lib/prismic/fragments/embed.rb', line 5 def html @html end  | 
  
#o_embed_json ⇒ Object
Returns the value of attribute o_embed_json
      5 6 7  | 
    
      # File 'lib/prismic/fragments/embed.rb', line 5 def @o_embed_json end  | 
  
#provider ⇒ Object
Returns the value of attribute provider
      5 6 7  | 
    
      # File 'lib/prismic/fragments/embed.rb', line 5 def provider @provider end  | 
  
#url ⇒ Object
Returns the value of attribute url
      5 6 7  | 
    
      # File 'lib/prismic/fragments/embed.rb', line 5 def url @url end  | 
  
Instance Method Details
#as_html(link_resolver = nil, html_serializer = nil) ⇒ String
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  |