Class: Ui::DescriptiveList::Item
- Inherits:
-
Component
- Object
- Cell::ViewModel
- Component
- Ui::DescriptiveList::Item
show all
- Defined in:
- lib/ui/descriptive_list/item.rb
Constant Summary
Constants inherited
from Component
Component::VIEWPATH
Instance Method Summary
collapse
Methods inherited from Component
#capture, #icon, #render_group
Instance Method Details
#display(value) ⇒ Object
21
22
23
24
25
26
27
|
# File 'lib/ui/descriptive_list/item.rb', line 21
def display(value)
if value.is_a?(Proc)
value.call
else
value
end
end
|
#item_title ⇒ Object
29
30
31
|
# File 'lib/ui/descriptive_list/item.rb', line 29
def item_title
model[0]
end
|
#item_value ⇒ Object
33
34
35
|
# File 'lib/ui/descriptive_list/item.rb', line 33
def item_value
model[1]
end
|
#show ⇒ Object
4
5
6
7
8
9
10
11
12
13
|
# File 'lib/ui/descriptive_list/item.rb', line 4
def show
content_tag(
:div,
render_group([
content_tag(:dt, item_title),
content_tag(:dd, value)
]),
class: 'ui-descriptive-list__item'
)
end
|
#value ⇒ Object
15
16
17
18
19
|
# File 'lib/ui/descriptive_list/item.rb', line 15
def value
render_group([
display(item_value)
])
end
|