Class: Hotchoc::Blocks::Image
- Inherits:
-
Base
show all
- Defined in:
- lib/hotchoc/blocks/image.rb
Instance Attribute Summary
#item
Instance Method Summary
collapse
Methods inherited from Base
#created_at, #id, #position, #type, #updated_at
#initialize
Constructor Details
This class inherits a constructor from Hotchoc::Base
Instance Method Details
#image ⇒ Object
8
9
10
|
# File 'lib/hotchoc/blocks/image.rb', line 8
def image
@item['content']['image'] ? Hotchoc::File.new(@item['content']['image']) : nil
end
|
#inspect ⇒ Object
12
13
14
|
# File 'lib/hotchoc/blocks/image.rb', line 12
def inspect
%(#<Hotchoc::Blocks::Image: title="#{title}" position="#{position}">)
end
|
#title ⇒ Object
4
5
6
|
# File 'lib/hotchoc/blocks/image.rb', line 4
def title
@item['content']['title']
end
|