Class: ContentBlockTools::Presenters::BlockPresenters::Contact::TelephonePresenter
- Inherits:
-
BasePresenter
- Object
- BasePresenter
- ContentBlockTools::Presenters::BlockPresenters::Contact::TelephonePresenter
show all
- Defined in:
- lib/content_block_tools/presenters/block_presenters/contact/telephone_presenter.rb
Instance Attribute Summary
#item
Instance Method Summary
collapse
#initialize, #title_content
Instance Method Details
#number_list ⇒ Object
12
13
14
15
16
17
18
|
# File 'lib/content_block_tools/presenters/block_presenters/contact/telephone_presenter.rb', line 12
def number_list
content_tag(:ul, class: "govuk-!-padding-0", style: "list-style: none;") do
item[:telephone_numbers].each do |number|
concat number_list_item(number)
end
end
end
|
#number_list_item(number) ⇒ Object
20
21
22
23
24
25
26
27
28
|
# File 'lib/content_block_tools/presenters/block_presenters/contact/telephone_presenter.rb', line 20
def number_list_item(number)
content_tag(:li) do
concat content_tag(:span, "#{number[:label]}: ")
concat content_tag(:a,
number[:telephone_number],
class: "govuk-link",
href: "tel:#{CGI.escape number[:telephone_number]}")
end
end
|
#render ⇒ Object
6
7
8
9
10
|
# File 'lib/content_block_tools/presenters/block_presenters/contact/telephone_presenter.rb', line 6
def render
content_tag(:div, class: "govuk-body govuk-!-margin-bottom-4") do
concat number_list
end
end
|