Class: NfgUi::Bootstrap::Components::Table

Inherits:
Base
  • Object
show all
Includes:
Utilities::Responsiveable, Utilities::Sizable
Defined in:
lib/nfg_ui/bootstrap/components/table.rb

Overview

Bootstrap Table Component getbootstrap.com/docs/4.1/content/tables/

Direct Known Subclasses

Components::Elements::Table

Instance Attribute Summary

Attributes inherited from Base

#body, #options, #view_context

Instance Method Summary collapse

Methods included from Utilities::Responsiveable

#responsive

Methods inherited from Base

#component_family, #data, #href, #html_options, #id, #initialize, #style

Constructor Details

This class inherits a constructor from NfgUi::Bootstrap::Components::Base

Instance Method Details

#borderedObject



32
33
34
# File 'lib/nfg_ui/bootstrap/components/table.rb', line 32

def bordered
  options.fetch(:bordered, false)
end

#renderObject



20
21
22
23
24
25
26
# File 'lib/nfg_ui/bootstrap/components/table.rb', line 20

def render
  if responsive
    (:div, class: responsive_css_class) { super }
  else
    super
  end
end

#sizeObject



12
13
14
15
16
17
18
# File 'lib/nfg_ui/bootstrap/components/table.rb', line 12

def size
  if options.fetch(:size, nil) == :lg
    raise ArgumentError.new I18n.t('nfg_ui.errors.argument_error.components.table.size')
  else
    super
  end
end

#stripedObject



28
29
30
# File 'lib/nfg_ui/bootstrap/components/table.rb', line 28

def striped
  options.fetch(:striped, false)
end