Class: Voom::Presenters::DSL::Components::Table::Row

Inherits:
Base
  • Object
show all
Defined in:
lib/voom/presenters/dsl/components/table.rb

Overview

WIP def pagination(**attribs, &block)

@pagination = Pagination.new(parent: self,
                             context: context,
                             **attribs, &block)

end

Defined Under Namespace

Classes: Column

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes, #context, #id, #type

Instance Method Summary collapse

Methods inherited from Base

#expand!

Methods included from Serializer

#to_hash

Methods included from Lockable

#lock!, #locked?

Constructor Details

#initialize(type:, **attribs_, &block) ⇒ Row

Returns a new instance of Row.



45
46
47
48
49
50
# File 'lib/voom/presenters/dsl/components/table.rb', line 45

def initialize(type:, **attribs_, &block)
  super(type: type, **attribs_, &block)
  @columns = []
  @color = attribs.delete(:color)
  expand!
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



43
44
45
# File 'lib/voom/presenters/dsl/components/table.rb', line 43

def color
  @color
end

#columnsObject

Returns the value of attribute columns.



43
44
45
# File 'lib/voom/presenters/dsl/components/table.rb', line 43

def columns
  @columns
end

Instance Method Details

#column(value = nil, **attribs, &block) ⇒ Object



52
53
54
55
56
# File 'lib/voom/presenters/dsl/components/table.rb', line 52

def column(value=nil, **attribs, &block)
  @columns << Column.new(parent: self, value: value,
                         context: context,
                         **attribs, &block)
end