Module: ContentBlockTools::Presenters::BlockPresenters::Contact::BlockLevelContactItem

Included in:
ContactFormPresenter, EmailAddressPresenter, TelephonePresenter
Defined in:
lib/content_block_tools/presenters/block_presenters/contact/block_level_contact_item.rb

Constant Summary collapse

BASE_TAG_TYPE =
:div

Instance Method Summary collapse

Instance Method Details

#initialize(item, rendering_context: :block, **_args) ⇒ Object



8
9
10
11
# File 'lib/content_block_tools/presenters/block_presenters/contact/block_level_contact_item.rb', line 8

def initialize(item, rendering_context: :block, **_args)
  @item = item
  @rendering_context = rendering_context
end

#wrapper(&block) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/content_block_tools/presenters/block_presenters/contact/block_level_contact_item.rb', line 13

def wrapper(&block)
  if @rendering_context == :field_names
    (:div, class: "contact") do
      (:div, class: "email-url-number") do
        yield block
      end
    end
  else
    (:div, class: "email-url-number") do
      yield block
    end
  end
end