Class: Primer::Forms::Caption
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Primer::Forms::Caption
- Defined in:
- app/lib/primer/forms/caption.rb
Overview
:nodoc:
Instance Method Summary collapse
- #before_render ⇒ Object
- #caption_template? ⇒ Boolean
-
#initialize(input:) ⇒ Caption
constructor
A new instance of Caption.
- #render_caption_template ⇒ Object
Methods inherited from BaseComponent
compile!, #content, #input?, #perform_render, #render?, #to_component, #type
Methods included from ActsAsComponent
#compile!, extended, #renders_templates
Methods included from ClassNameHelper
Constructor Details
#initialize(input:) ⇒ Caption
Returns a new instance of Caption.
7 8 9 |
# File 'app/lib/primer/forms/caption.rb', line 7 def initialize(input:) @input = input end |
Instance Method Details
#before_render ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'app/lib/primer/forms/caption.rb', line 19 def before_render return unless @input. && raise <<~MESSAGE Please provide either a caption: argument or caption template for the '#{@input.name}' input; both were found. MESSAGE end |
#caption_template? ⇒ Boolean
11 12 13 |
# File 'app/lib/primer/forms/caption.rb', line 11 def @input. end |
#render_caption_template ⇒ Object
15 16 17 |
# File 'app/lib/primer/forms/caption.rb', line 15 def @input. end |