Class: Prismic::Fragments::StructuredText::Block::Image
- Inherits:
 - 
      Prismic::Fragments::StructuredText::Block
      
        
- Object
 - Prismic::Fragments::StructuredText::Block
 - Prismic::Fragments::StructuredText::Block::Image
 
 
- Defined in:
 - lib/prismic/fragments/structured_text.rb
 
Instance Attribute Summary collapse
- 
  
    
      #label  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute label.
 - 
  
    
      #view  ⇒ Object 
    
    
  
  
  
  
    
    
  
  
  
  
  
  
    
Returns the value of attribute view.
 
Instance Method Summary collapse
- #alt ⇒ Object
 - #as_html(link_resolver, html_serializer = nil) ⇒ Object
 - #copyright ⇒ Object
 - #height ⇒ Object
 - 
  
    
      #initialize(view, label = nil)  ⇒ Image 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    
A new instance of Image.
 - #link_to ⇒ Object
 - #url ⇒ Object
 - #width ⇒ Object
 
Methods inherited from Prismic::Fragments::StructuredText::Block
Constructor Details
#initialize(view, label = nil) ⇒ Image
Returns a new instance of Image
      326 327 328 329  | 
    
      # File 'lib/prismic/fragments/structured_text.rb', line 326 def initialize(view, label = nil) @view = view @label = label end  | 
  
Instance Attribute Details
#label ⇒ Object
Returns the value of attribute label
      324 325 326  | 
    
      # File 'lib/prismic/fragments/structured_text.rb', line 324 def label @label end  | 
  
#view ⇒ Object
Returns the value of attribute view
      324 325 326  | 
    
      # File 'lib/prismic/fragments/structured_text.rb', line 324 def view @view end  | 
  
Instance Method Details
#alt ⇒ Object
      343 344 345  | 
    
      # File 'lib/prismic/fragments/structured_text.rb', line 343 def alt @view.alt end  | 
  
#as_html(link_resolver, html_serializer = nil) ⇒ Object
      355 356 357 358 359 360 361 362 363 364 365 366 367 368 369  | 
    
      # File 'lib/prismic/fragments/structured_text.rb', line 355 def as_html(link_resolver, html_serializer = nil) custom = nil unless html_serializer.nil? custom = html_serializer.serialize(self, '') end if custom.nil? classes = ['block-img'] unless @label.nil? classes.push(@label) end %(<p class="#{classes.join(' ')}">#{view.as_html(link_resolver)}</p>) else custom end end  | 
  
#copyright ⇒ Object
      347 348 349  | 
    
      # File 'lib/prismic/fragments/structured_text.rb', line 347 def copyright @view.copyright end  | 
  
#height ⇒ Object
      339 340 341  | 
    
      # File 'lib/prismic/fragments/structured_text.rb', line 339 def height @view.height end  | 
  
#link_to ⇒ Object
      351 352 353  | 
    
      # File 'lib/prismic/fragments/structured_text.rb', line 351 def link_to @view.link_to end  | 
  
#url ⇒ Object
      331 332 333  | 
    
      # File 'lib/prismic/fragments/structured_text.rb', line 331 def url @view.url end  | 
  
#width ⇒ Object
      335 336 337  | 
    
      # File 'lib/prismic/fragments/structured_text.rb', line 335 def width @view.width end  |