Class: Voom::Presenters::DSL::Components::ImageList
- Defined in:
- lib/voom/presenters/dsl/components/image_list.rb
Defined Under Namespace
Classes: ImageListItem
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#images ⇒ Object
readonly
Returns the value of attribute images.
-
#list_type ⇒ Object
readonly
Returns the value of attribute list_type.
-
#spacing ⇒ Object
readonly
Returns the value of attribute spacing.
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
- #image(image = nil, **attribs, &block) ⇒ Object
-
#initialize(**attribs_, &block) ⇒ ImageList
constructor
A new instance of ImageList.
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(**attribs_, &block) ⇒ ImageList
Returns a new instance of ImageList.
9 10 11 12 13 14 15 16 17 |
# File 'lib/voom/presenters/dsl/components/image_list.rb', line 9 def initialize(**attribs_, &block) super(type: :image_list, **attribs_, &block) @images = [] @columns = attribs_.delete(:columns){ 5 } @list_type = attribs_.delete(:list_type){ 'standard' } @spacing = attribs_.delete(:spacing) @border_attribs = attribs_.slice(:border, :border_color, :border_radius) end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
7 8 9 |
# File 'lib/voom/presenters/dsl/components/image_list.rb', line 7 def columns @columns end |
#images ⇒ Object (readonly)
Returns the value of attribute images.
7 8 9 |
# File 'lib/voom/presenters/dsl/components/image_list.rb', line 7 def images @images end |
#list_type ⇒ Object (readonly)
Returns the value of attribute list_type.
7 8 9 |
# File 'lib/voom/presenters/dsl/components/image_list.rb', line 7 def list_type @list_type end |
#spacing ⇒ Object (readonly)
Returns the value of attribute spacing.
7 8 9 |
# File 'lib/voom/presenters/dsl/components/image_list.rb', line 7 def spacing @spacing end |
Instance Method Details
#image(image = nil, **attribs, &block) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/voom/presenters/dsl/components/image_list.rb', line 19 def image(image=nil, **attribs, &block) combined_attribs = attribs.merge(@border_attribs) @images << ImageListItem.new(parent: self, image: image, **combined_attribs, &block) end |