Class: Primer::Forms::BaseComponent
- Inherits:
-
Object
- Object
- Primer::Forms::BaseComponent
- Extended by:
- ActsAsComponent
- Includes:
- ClassNameHelper
- Defined in:
- lib/primer/forms/base_component.rb
Overview
:nodoc:
Direct Known Subclasses
Caption, CheckBox, CheckBoxGroup, FormControl, FormReference, Group, HiddenField, Multi, RadioButton, RadioButtonGroup, SelectList, Separator, SpacingWrapper, SubmitButton, TextArea, TextField
Instance Attribute Summary
Attributes included from ActsAsComponent
Class Method Summary collapse
Instance Method Summary collapse
- #content ⇒ Object
-
#input? ⇒ Boolean
:nocov:.
- #perform_render(&block) ⇒ Object
- #to_component ⇒ Object
-
#type ⇒ Object
:nocov:.
Methods included from ActsAsComponent
compile!, extended, renders_templates
Methods included from ClassNameHelper
Class Method Details
.inherited(base) ⇒ Object
12 13 14 |
# File 'lib/primer/forms/base_component.rb', line 12 def self.inherited(base) base.renders_template File.join(__dir__, "#{base.name.demodulize.underscore}.html.erb"), :render_template end |
Instance Method Details
#content ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/primer/forms/base_component.rb', line 23 def content return @__prf_content if defined?(@__prf_content_evaluated) && @__prf_content_evaluated @__prf_content_evaluated = true @__prf_content = capture do @__prf_content_block.call end end |
#input? ⇒ Boolean
:nocov:
38 39 40 |
# File 'lib/primer/forms/base_component.rb', line 38 def input? false end |
#perform_render(&block) ⇒ Object
18 19 20 21 |
# File 'lib/primer/forms/base_component.rb', line 18 def perform_render(&block) @__prf_content_block = block compile_and_render_template end |
#to_component ⇒ Object
42 43 44 |
# File 'lib/primer/forms/base_component.rb', line 42 def to_component self end |
#type ⇒ Object
:nocov:
33 34 35 |
# File 'lib/primer/forms/base_component.rb', line 33 def type :component end |