Class: Voom::Presenters::DSL::Components::Table::Row::Column
- Includes:
- Mixins::Chips, Mixins::Icons, Mixins::Selects, Mixins::Tooltips
- Defined in:
- lib/voom/presenters/dsl/components/table.rb
Instance Attribute Summary collapse
-
#color ⇒ Object
Returns the value of attribute color.
-
#components ⇒ Object
Returns the value of attribute components.
-
#numeric ⇒ Object
Returns the value of attribute numeric.
Attributes inherited from EventBase
Attributes included from Mixins::Event
Attributes inherited from Base
#attributes, #context, #id, #type
Instance Method Summary collapse
-
#initialize(**attribs_, &block) ⇒ Column
constructor
A new instance of Column.
- #value(*value, **attribs, &block) ⇒ Object
Methods included from Mixins::Icons
Methods included from Mixins::Selects
Methods included from Mixins::Chips
Methods included from Mixins::Append
Methods included from Mixins::Tooltips
Methods included from Mixins::Event
Methods inherited from Base
Methods included from Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
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 = [] end |
Instance Attribute Details
#color ⇒ Object
Returns the value of attribute color.
64 65 66 |
# File 'lib/voom/presenters/dsl/components/table.rb', line 64 def color @color end |
#components ⇒ Object
Returns the value of attribute components.
64 65 66 |
# File 'lib/voom/presenters/dsl/components/table.rb', line 64 def components @components end |
#numeric ⇒ Object
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 |