Class: Hotchoc::Blocks::Image

Inherits:
Base show all
Defined in:
lib/hotchoc/blocks/image.rb

Instance Attribute Summary

Attributes inherited from Hotchoc::Base

#item

Instance Method Summary collapse

Methods inherited from Base

#created_at, #id, #position, #type, #updated_at

Methods inherited from Hotchoc::Base

#initialize

Constructor Details

This class inherits a constructor from Hotchoc::Base

Instance Method Details

#imageObject



8
9
10
# File 'lib/hotchoc/blocks/image.rb', line 8

def image
  @item['content']['image'] ? Hotchoc::File.new(@item['content']['image']) : nil
end

#inspectObject



12
13
14
# File 'lib/hotchoc/blocks/image.rb', line 12

def inspect
  %(#<Hotchoc::Blocks::Image: title="#{title}" position="#{position}">)
end

#titleObject



4
5
6
# File 'lib/hotchoc/blocks/image.rb', line 4

def title
  @item['content']['title']
end