Class: ContentBlockTools::Presenters::BlockPresenters::Contact::ContactLinkPresenter
Constant Summary
BlockLevelContactItem::BASE_TAG_TYPE
BasePresenter::BASE_TAG_TYPE
Instance Attribute Summary
#item
Instance Method Summary
collapse
#initialize, #title, #wrapper
#initialize
Methods included from Govspeak
#render_govspeak
Instance Method Details
#description ⇒ Object
32
33
34
35
36
|
# File 'lib/content_block_tools/presenters/block_presenters/contact/contact_link_presenter.rb', line 32
def description
content_tag(:li) do
render_govspeak(item[:description])
end
end
|
#link ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'lib/content_block_tools/presenters/block_presenters/contact/contact_link_presenter.rb', line 19
def link
content_tag(:li) do
content_tag(:a,
link_text,
class: "url content-block__link",
href: item[:url])
end
end
|
#link_text ⇒ Object
28
29
30
|
# File 'lib/content_block_tools/presenters/block_presenters/contact/contact_link_presenter.rb', line 28
def link_text
item[:label] || item[:url]
end
|
#render ⇒ Object
10
11
12
13
14
15
16
17
|
# File 'lib/content_block_tools/presenters/block_presenters/contact/contact_link_presenter.rb', line 10
def render
wrapper do
content_tag(:ul, class: "content-block__list") do
concat link
concat description if item[:description]
end
end
end
|