Class: Superview::Components::TableComponent::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/superview/components/table_component.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#item_templateObject

Returns the value of attribute item_template.



36
37
38
# File 'lib/superview/components/table_component.rb', line 36

def item_template
  @item_template
end

#title_templateObject

Returns the value of attribute title_template.



36
37
38
# File 'lib/superview/components/table_component.rb', line 36

def title_template
  @title_template
end

Class Method Details

.build(title:, &block) ⇒ Object



46
47
48
49
50
51
# File 'lib/superview/components/table_component.rb', line 46

def self.build(title:, &block)
  new.tap do |column|
    column.title { title }
    column.item(&block)
  end
end

Instance Method Details

#item(&block) ⇒ Object



42
43
44
# File 'lib/superview/components/table_component.rb', line 42

def item(&block)
  @item_template = block
end

#title(&block) ⇒ Object



38
39
40
# File 'lib/superview/components/table_component.rb', line 38

def title(&block)
  @title_template = block
end