Class: ViewComponent::DocsBuilderComponent::ErrorKlassDoc
- Inherits:
-
Base
- Object
- ActionView::Base
- Base
- ViewComponent::DocsBuilderComponent::ErrorKlassDoc
- Defined in:
- lib/view_component/docs_builder_component.rb
Constant Summary
Constants inherited from Base
Base::RESERVED_PARAMETER, Base::VC_INTERNAL_DEFAULT_FORMAT
Constants included from Translatable
Translatable::HTML_SAFE_TRANSLATION_KEY, Translatable::TRANSLATION_EXTENSIONS
Constants included from Slotable
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #call ⇒ Object
- #error_message ⇒ Object
-
#initialize(error_klass, _show_types) ⇒ ErrorKlassDoc
constructor
A new instance of ErrorKlassDoc.
- #klass_name ⇒ Object
Methods inherited from Base
#__vc_request, #before_render, collection_counter_parameter, collection_iteration_parameter, collection_parameter, compile, compiled?, compiler, config, #content, #content?, #controller, counter_argument_present?, ensure_compiled, #format, #helpers, inherited, iteration_argument_present?, #method_missing, #output_postamble, #output_preamble, #render, #render?, #render_in, #render_parent, #render_parent_to_string, #request, #set_original_view_context, sidecar_files, strip_trailing_whitespace, strip_trailing_whitespace?, validate_collection_parameter!, validate_initialization_parameters!, #view_cache_dependencies, #virtual_path, with_collection, with_collection_parameter
Methods included from WithContentHelper
Methods included from Translatable
Methods included from Slotable
#get_slot, #set_polymorphic_slot, #set_slot
Constructor Details
#initialize(error_klass, _show_types) ⇒ ErrorKlassDoc
Returns a new instance of ErrorKlassDoc.
14 15 16 |
# File 'lib/view_component/docs_builder_component.rb', line 14 def initialize(error_klass, _show_types) @error_klass = error_klass end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ViewComponent::Base
Instance Method Details
#call ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/view_component/docs_builder_component.rb', line 26 def call <<~DOCS.chomp `#{klass_name}` #{} DOCS end |
#error_message ⇒ Object
22 23 24 |
# File 'lib/view_component/docs_builder_component.rb', line 22 def ViewComponent.const_get(@error_klass) end |
#klass_name ⇒ Object
18 19 20 |
# File 'lib/view_component/docs_builder_component.rb', line 18 def klass_name @error_klass.gsub("ViewComponent::", "").gsub("::MESSAGE", "") end |