Class: Crm::UploadWrapperComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Crm::UploadWrapperComponent
- Defined in:
- app/components/crm/upload_wrapper_component.rb
Instance Attribute Summary collapse
-
#context_class ⇒ Object
readonly
Returns the value of attribute context_class.
-
#context_object ⇒ Object
readonly
Returns the value of attribute context_object.
-
#controller_path ⇒ Object
readonly
Returns the value of attribute controller_path.
-
#disable_delete ⇒ Object
readonly
Returns the value of attribute disable_delete.
-
#parent_form_id ⇒ Object
readonly
Returns the value of attribute parent_form_id.
-
#upload ⇒ Object
readonly
Returns the value of attribute upload.
Instance Method Summary collapse
-
#initialize(upload:, context_object:, context_class: nil, controller_path: nil, disable_delete: false, parent_form_id: nil) ⇒ UploadWrapperComponent
constructor
A new instance of UploadWrapperComponent.
Constructor Details
#initialize(upload:, context_object:, context_class: nil, controller_path: nil, disable_delete: false, parent_form_id: nil) ⇒ UploadWrapperComponent
Returns a new instance of UploadWrapperComponent.
6 7 8 9 10 11 12 13 14 |
# File 'app/components/crm/upload_wrapper_component.rb', line 6 def initialize(upload:, context_object:, context_class: nil, controller_path: nil, disable_delete: false, parent_form_id: nil) super() @upload = upload @context_object = context_object @context_class = context_class || context_object.class @controller_path = controller_path || context_object.class.name.tableize @disable_delete = disable_delete @parent_form_id = parent_form_id end |
Instance Attribute Details
#context_class ⇒ Object (readonly)
Returns the value of attribute context_class.
4 5 6 |
# File 'app/components/crm/upload_wrapper_component.rb', line 4 def context_class @context_class end |
#context_object ⇒ Object (readonly)
Returns the value of attribute context_object.
4 5 6 |
# File 'app/components/crm/upload_wrapper_component.rb', line 4 def context_object @context_object end |
#controller_path ⇒ Object (readonly)
Returns the value of attribute controller_path.
4 5 6 |
# File 'app/components/crm/upload_wrapper_component.rb', line 4 def controller_path @controller_path end |
#disable_delete ⇒ Object (readonly)
Returns the value of attribute disable_delete.
4 5 6 |
# File 'app/components/crm/upload_wrapper_component.rb', line 4 def disable_delete @disable_delete end |
#parent_form_id ⇒ Object (readonly)
Returns the value of attribute parent_form_id.
4 5 6 |
# File 'app/components/crm/upload_wrapper_component.rb', line 4 def parent_form_id @parent_form_id end |
#upload ⇒ Object (readonly)
Returns the value of attribute upload.
4 5 6 |
# File 'app/components/crm/upload_wrapper_component.rb', line 4 def upload @upload end |