Class: Crm::UploadWrapperComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/crm/upload_wrapper_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_classObject (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_objectObject (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_pathObject (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_deleteObject (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_idObject (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

#uploadObject (readonly)

Returns the value of attribute upload.



4
5
6
# File 'app/components/crm/upload_wrapper_component.rb', line 4

def upload
  @upload
end