Class: Protos::Table

Inherits:
Component show all
Defined in:
lib/protos/table.rb,
lib/protos/table/row.rb,
lib/protos/table/body.rb,
lib/protos/table/cell.rb,
lib/protos/table/head.rb,
lib/protos/table/footer.rb,
lib/protos/table/header.rb,
lib/protos/table/caption.rb

Defined Under Namespace

Classes: Body, Caption, Cell, Footer, Head, Header, Row

Constant Summary collapse

Sizes =
Types::Coercible::Symbol.enum(
  :xs,
  :sm,
  :md,
  :lg
)
SIZES =
{
  xs: "table-xs",
  sm: "table-sm",
  md: "table-md",
  lg: "table-lg"
}.freeze

Instance Method Summary collapse

Methods inherited from Component

#initialize

Constructor Details

This class inherits a constructor from Protos::Component

Instance Method Details

#bodyObject



44
# File 'lib/protos/table.rb', line 44

def body(...) = render Body.new(...)

#captionObject



46
# File 'lib/protos/table.rb', line 46

def caption(...) = render Caption.new(...)

#cellObject



48
# File 'lib/protos/table.rb', line 48

def cell(...) = render Cell.new(...)


50
# File 'lib/protos/table.rb', line 50

def footer(...) = render Footer.new(...)

#headObject



52
# File 'lib/protos/table.rb', line 52

def head(...) = render Head.new(...)

#headerObject



54
# File 'lib/protos/table.rb', line 54

def header(...) = render Header.new(...)

#rowObject



56
# File 'lib/protos/table.rb', line 56

def row(...) = render Row.new(...)

#view_template(&block) ⇒ Object



38
39
40
41
42
# File 'lib/protos/table.rb', line 38

def view_template(&block)
  div(**attrs) do
    table(class: css[:table], &block)
  end
end