Class: Govspeak::AttachmentImagePresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/govspeak/presenters/attachment_image_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attachment) ⇒ AttachmentImagePresenter

Returns a new instance of AttachmentImagePresenter.



5
6
7
# File 'lib/govspeak/presenters/attachment_image_presenter.rb', line 5

def initialize(attachment)
  @attachment = AttachmentPresenter.new(attachment)
end

Instance Attribute Details

#attachmentObject (readonly)

Returns the value of attribute attachment.



3
4
5
# File 'lib/govspeak/presenters/attachment_image_presenter.rb', line 3

def attachment
  @attachment
end

Instance Method Details

#alt_textObject



13
14
15
# File 'lib/govspeak/presenters/attachment_image_presenter.rb', line 13

def alt_text
  (attachment.title || "").tr("\n", " ")
end

#captionObject



17
18
19
# File 'lib/govspeak/presenters/attachment_image_presenter.rb', line 17

def caption
  nil
end

#creditObject



21
22
23
# File 'lib/govspeak/presenters/attachment_image_presenter.rb', line 21

def credit
  nil
end

#figcaption?Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/govspeak/presenters/attachment_image_presenter.rb', line 29

def figcaption?
  false
end

#figcaption_htmlObject



33
34
35
# File 'lib/govspeak/presenters/attachment_image_presenter.rb', line 33

def figcaption_html
  nil
end

#idObject



25
26
27
# File 'lib/govspeak/presenters/attachment_image_presenter.rb', line 25

def id
  attachment.id
end

#urlObject



9
10
11
# File 'lib/govspeak/presenters/attachment_image_presenter.rb', line 9

def url
  attachment.url
end