Class: Practical::Views::Form::PracticalEditorComponent
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- Practical::Views::Form::PracticalEditorComponent
- Defined in:
- app/components/practical/views/form/practical_editor_component.rb
Instance Attribute Summary collapse
-
#aria_describedby_id ⇒ Object
Returns the value of attribute aria_describedby_id.
-
#direct_upload_url ⇒ Object
Returns the value of attribute direct_upload_url.
-
#input_id ⇒ Object
Returns the value of attribute input_id.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #call ⇒ Object
- #finalized_options ⇒ Object
-
#initialize(input_id:, aria_describedby_id:, direct_upload_url:, options: {}) ⇒ PracticalEditorComponent
constructor
A new instance of PracticalEditorComponent.
Constructor Details
#initialize(input_id:, aria_describedby_id:, direct_upload_url:, options: {}) ⇒ PracticalEditorComponent
Returns a new instance of PracticalEditorComponent.
6 7 8 9 10 11 |
# File 'app/components/practical/views/form/practical_editor_component.rb', line 6 def initialize(input_id:, aria_describedby_id:, direct_upload_url:, options: {}) self.input_id = input_id self.aria_describedby_id = aria_describedby_id self.direct_upload_url = direct_upload_url self. = end |
Instance Attribute Details
#aria_describedby_id ⇒ Object
Returns the value of attribute aria_describedby_id.
4 5 6 |
# File 'app/components/practical/views/form/practical_editor_component.rb', line 4 def aria_describedby_id @aria_describedby_id end |
#direct_upload_url ⇒ Object
Returns the value of attribute direct_upload_url.
4 5 6 |
# File 'app/components/practical/views/form/practical_editor_component.rb', line 4 def direct_upload_url @direct_upload_url end |
#input_id ⇒ Object
Returns the value of attribute input_id.
4 5 6 |
# File 'app/components/practical/views/form/practical_editor_component.rb', line 4 def input_id @input_id end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'app/components/practical/views/form/practical_editor_component.rb', line 4 def @options end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 |
# File 'app/components/practical/views/form/practical_editor_component.rb', line 21 def call tag.practical_editor(**) { tag.div("slot": :editor, "aria-describedby": aria_describedby_id) } end |
#finalized_options ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/components/practical/views/form/practical_editor_component.rb', line 13 def mix({ input: input_id, serializer: :json, data: {direct_upload_url: direct_upload_url} }, ) end |