Class: Voom::Presenters::DSL::Components::Grid
- Defined in:
- lib/voom/presenters/dsl/components/grid.rb
Defined Under Namespace
Classes: Column
Instance Attribute Summary collapse
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#gutter ⇒ Object
readonly
Returns the value of attribute gutter.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#padding ⇒ Object
readonly
Returns the value of attribute padding.
-
#wide ⇒ Object
readonly
Returns the value of attribute wide.
Attributes inherited from EventBase
Attributes included from Mixins::Event
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
- #column(size, color: nil, **attribs, &block) ⇒ Object
-
#initialize(color: nil, **attribs_, &block) ⇒ Grid
constructor
A new instance of Grid.
Methods included from Mixins::Padding
#coerce_padding, #validate_padding
Methods included from Mixins::Progress
Methods included from Mixins::Snackbars
Methods included from Mixins::Dialogs
Methods included from Mixins::Attaches
Methods included from Namespace
Methods included from Mixins::Event
Methods inherited from Base
Methods included from Pluggable
#include_plugins, #plugin, #plugin_module
Methods included from Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(color: nil, **attribs_, &block) ⇒ Grid
Returns a new instance of Grid.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 19 def initialize(color: nil, **attribs_, &block) super(type: :grid, **attribs_, &block) @columns = [] @color = color padding = attribs.delete(:padding) {nil} @padding = validate_padding(coerce_padding(padding, default_level: 3)).uniq if padding != nil @wide = attribs.delete(:wide) {false} @gutter = coerce_gutter(attribs.delete(:gutter) {nil}) @height = attribs.delete(:height) {nil} end |
Instance Attribute Details
#color ⇒ Object (readonly)
Returns the value of attribute color.
12 13 14 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 12 def color @color end |
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
12 13 14 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 12 def columns @columns end |
#gutter ⇒ Object (readonly)
Returns the value of attribute gutter.
12 13 14 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 12 def gutter @gutter end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
12 13 14 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 12 def height @height end |
#padding ⇒ Object (readonly)
Returns the value of attribute padding.
12 13 14 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 12 def padding @padding end |
#wide ⇒ Object (readonly)
Returns the value of attribute wide.
12 13 14 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 12 def wide @wide end |
Instance Method Details
#column(size, color: nil, **attribs, &block) ⇒ Object
31 32 33 34 35 |
# File 'lib/voom/presenters/dsl/components/grid.rb', line 31 def column(size, color: nil, **attribs, &block) attribs = size.respond_to?(:keys) ? attribs.merge(size) : attribs.merge(size: size) @columns << Column.new(parent: self, color: color, **attribs, &block) end |