Class: UiBibz::Ui::Ux::Tables::Actionable

Inherits:
Base
  • Object
show all
Defined in:
lib/ui_bibz/ui/ux/tables/extensions/actionable.rb

Instance Attribute Summary

Attributes inherited from Base

#output_buffer

Instance Method Summary collapse

Methods inherited from Base

#generate_id, #i18n_set?, #inject_url

Constructor Details

#initialize(store, options, actions = nil) ⇒ Actionable

Returns a new instance of Actionable.



5
6
7
8
9
# File 'lib/ui_bibz/ui/ux/tables/extensions/actionable.rb', line 5

def initialize(store, options, actions = nil)
  @store   = store
  @options = options
  @actions = actions
end

Instance Method Details

#actionable?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/ui_bibz/ui/ux/tables/extensions/actionable.rb', line 11

def actionable?
  @options[:actionable].nil? ? true : @options[:actionable]
end

#body(record, tds) ⇒ Object



20
21
22
23
# File 'lib/ui_bibz/ui/ux/tables/extensions/actionable.rb', line 20

def body(record, tds)
  tds << td_action(record) if actionable?
  tds
end

#header(ths) ⇒ Object



15
16
17
18
# File 'lib/ui_bibz/ui/ux/tables/extensions/actionable.rb', line 15

def header(ths)
  ths << (:th, '', class: 'action') if actionable?
  ths
end