Class: Bootstrap4Helper::CardGrouping
- Defined in:
- lib/bootstrap4_helper/card_grouping.rb
Overview
Class for other Card group type components to inherit from.
Direct Known Subclasses
Instance Method Summary collapse
-
#card(opts = {}, &block) ⇒ Card
Builds a ‘Card` for the grouping class.
-
#initialize(template, opts = {}, &block) ⇒ Card
constructor
Used to initialize a new Card Grouping.
Methods inherited from Component
#capture, #concat, #config, #content_tag, #parse_arguments, #uuid
Constructor Details
#initialize(template, opts = {}, &block) ⇒ Card
Used to initialize a new Card Grouping.
15 16 17 18 19 20 21 22 |
# File 'lib/bootstrap4_helper/card_grouping.rb', line 15 def initialize(template, opts = {}, &block) super(template) @id = opts.fetch(:id, '') @class = opts.fetch(:class, '') @data = opts.fetch(:data, nil) @content = block || proc { '' } end |
Instance Method Details
#card(opts = {}, &block) ⇒ Card
Builds a ‘Card` for the grouping class.
29 30 31 |
# File 'lib/bootstrap4_helper/card_grouping.rb', line 29 def card(opts = {}, &block) Card.new(@template, opts, &block) end |