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

Inherits:
EventBase
  • Object
show all
Includes:
Mixins::Chips, Mixins::Icons, Mixins::Selects, Mixins::Tooltips
Defined in:
lib/voom/presenters/dsl/components/table.rb

Instance Attribute Summary collapse

Attributes inherited from EventBase

#event_parent_id

Attributes included from Mixins::Event

#events

Attributes inherited from Base

#attributes, #context, #id, #type

Instance Method Summary collapse

Methods included from Mixins::Icons

#icon

Methods included from Mixins::Selects

#select

Methods included from Mixins::Chips

#chip

Methods included from Mixins::Append

#<<, #yield_to

Methods included from Mixins::Tooltips

#tooltip

Methods included from Mixins::Event

#event

Methods inherited from Base

#expand!

Methods included from Mixins::YieldTo

#yield_to

Methods included from Serializer

#to_hash

Methods included from Lockable

#lock!, #locked?

Constructor Details

#initialize(**attribs_, &block) ⇒ Column

Returns a new instance of Column.



66
67
68
69
70
71
72
73
74
# File 'lib/voom/presenters/dsl/components/table.rb', line 66

def initialize(**attribs_, &block)
  super(type: :column, **attribs_, &block)
  value = attribs.delete(:value)
  @numeric = attribs.delete(:numeric){numeric?(value)}
  self.value(value) if value
  @color = attribs.delete(:color)
  @components = []
  expand!
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



64
65
66
# File 'lib/voom/presenters/dsl/components/table.rb', line 64

def color
  @color
end

#componentsObject

Returns the value of attribute components.



64
65
66
# File 'lib/voom/presenters/dsl/components/table.rb', line 64

def components
  @components
end

#numericObject

Returns the value of attribute numeric.



64
65
66
# File 'lib/voom/presenters/dsl/components/table.rb', line 64

def numeric
  @numeric
end

Instance Method Details

#value(*value, **attribs, &block) ⇒ Object



76
77
78
79
# File 'lib/voom/presenters/dsl/components/table.rb', line 76

def value(*value, **attribs, &block)
  return @value if locked?
  @value = Components::Typography.new(parent: self, type: :text, text: value, context: context, **attribs, &block)
end