Class: UiBibz::Ui::Ux::Tables::As

Inherits:
Object
  • Object
show all
Defined in:
lib/ui_bibz/ui/ux/tables/components/as.rb

Overview

As

Instance Method Summary collapse

Constructor Details

#initialize(col, record, content, table_options) ⇒ As

Returns a new instance of As.



7
8
9
10
11
12
# File 'lib/ui_bibz/ui/ux/tables/components/as.rb', line 7

def initialize(col, record, content, table_options)
  @col     = col
  @record  = record
  @content = content
  @form    = table_options.try(:[], :form)
end

Instance Method Details

#renderObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ui_bibz/ui/ux/tables/components/as.rb', line 14

def render
  case @col.as
  when :boolean
    boolean_render
  when :progress
    progress_render
  when :input
    inp_options = (@col.input_options || {}).merge({ label: false })
    @form.input @col.data_index, inp_options
  end
end