Class: Ui::DescriptiveList::Item

Inherits:
Component
  • Object
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

#showObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/ui/descriptive_list/item.rb', line 4

def show
  (
    :div,
    render_group([
      (:dt, title),
      (:dd, value)
    ]),
    class: 'ui-descriptive-list__item'
  )
end

#titleObject



15
16
17
# File 'lib/ui/descriptive_list/item.rb', line 15

def title
  model[0]
end

#valueObject



19
20
21
# File 'lib/ui/descriptive_list/item.rb', line 19

def value
  model[1].try(:call) || model[1]
end