Class: Avo::DiscreetInformationComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Avo::DiscreetInformationComponent
show all
- Defined in:
- app/components/avo/discreet_information_component.rb
Constant Summary
Concerns::FindAssociationField::ASSOCIATIONS
Instance Method Summary
collapse
#component_name, #has_with_trial
#find_association_field
Instance Method Details
#data(item) ⇒ Object
26
|
# File 'app/components/avo/discreet_information_component.rb', line 26
def data(item) = item.data || {}
|
#element_attributes(item) ⇒ Object
18
19
20
21
22
23
24
|
# File 'app/components/avo/discreet_information_component.rb', line 18
def element_attributes(item)
if item.url.present?
{href: item.url, target: item.url_target}
else
{}
end
end
|
#element_tag(item) ⇒ Object
10
11
12
13
14
15
16
|
# File 'app/components/avo/discreet_information_component.rb', line 10
def element_tag(item)
if item.url.present?
:a
else
:div
end
end
|
#items ⇒ Object
6
7
8
|
# File 'app/components/avo/discreet_information_component.rb', line 6
def items
@payload.items.compact
end
|