Class: Maglev::Uikit::ImageLibrary::UploaderComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- Maglev::Uikit::ImageLibrary::UploaderComponent
- Defined in:
- app/components/maglev/uikit/image_library/uploader_component.rb
Instance Attribute Summary collapse
-
#create_path ⇒ Object
readonly
Returns the value of attribute create_path.
-
#maxsize ⇒ Object
readonly
Returns the value of attribute maxsize.
-
#refresh_path ⇒ Object
readonly
Returns the value of attribute refresh_path.
Instance Method Summary collapse
- #error_message ⇒ Object
-
#initialize(create_path:, refresh_path:, maxsize: 2_048_144) ⇒ UploaderComponent
constructor
A new instance of UploaderComponent.
- #success_message ⇒ Object
- #too_big_error_message ⇒ Object
Methods inherited from BaseComponent
Constructor Details
#initialize(create_path:, refresh_path:, maxsize: 2_048_144) ⇒ UploaderComponent
Returns a new instance of UploaderComponent.
9 10 11 12 13 |
# File 'app/components/maglev/uikit/image_library/uploader_component.rb', line 9 def initialize(create_path:, refresh_path:, maxsize: 2_048_144) @create_path = create_path @refresh_path = refresh_path @maxsize = maxsize end |
Instance Attribute Details
#create_path ⇒ Object (readonly)
Returns the value of attribute create_path.
7 8 9 |
# File 'app/components/maglev/uikit/image_library/uploader_component.rb', line 7 def create_path @create_path end |
#maxsize ⇒ Object (readonly)
Returns the value of attribute maxsize.
7 8 9 |
# File 'app/components/maglev/uikit/image_library/uploader_component.rb', line 7 def maxsize @maxsize end |
#refresh_path ⇒ Object (readonly)
Returns the value of attribute refresh_path.
7 8 9 |
# File 'app/components/maglev/uikit/image_library/uploader_component.rb', line 7 def refresh_path @refresh_path end |
Instance Method Details
#error_message ⇒ Object
19 20 21 |
# File 'app/components/maglev/uikit/image_library/uploader_component.rb', line 19 def t('maglev.editor.image_library.uploader.upload_button.fail') end |
#success_message ⇒ Object
15 16 17 |
# File 'app/components/maglev/uikit/image_library/uploader_component.rb', line 15 def t('maglev.editor.image_library.uploader.upload_button.success') end |
#too_big_error_message ⇒ Object
23 24 25 |
# File 'app/components/maglev/uikit/image_library/uploader_component.rb', line 23 def t('maglev.editor.image_library.uploader.wrong_files', limit: number_to_human_size(maxsize)) end |