Class: Bootstrap3Helper::Callout
- Defined in:
- lib/bootstrap3_helper/callout.rb
Overview
Used to generate Bootstrap callout component quickly.
Instance Method Summary collapse
- #initialize(template, context_or_options = nil, opts = {}, &block) ⇒ Callout constructor
-
#to_s ⇒ String
Returns a string representation of the component.
Methods inherited from Component
#concat, #content_tag, #parse_arguments, #uuid
Constructor Details
#initialize(template, context_or_options = nil, opts = {}, &block) ⇒ Callout
13 14 15 16 17 18 19 20 |
# File 'lib/bootstrap3_helper/callout.rb', line 13 def initialize(template, = nil, opts = {}, &block) super(template) @context, args = parse_arguments(, opts) @id = args.fetch(:id, nil) @class = args.fetch(:class, '') @content = block || proc { '' } end |
Instance Method Details
#to_s ⇒ String
Returns a string representation of the component.
26 27 28 29 30 |
# File 'lib/bootstrap3_helper/callout.rb', line 26 def to_s content_tag :div, id: @id, class: container_class do @content.call(self) end end |