Class: RailsExecution::Config
- Inherits:
-
Object
- Object
- RailsExecution::Config
- Defined in:
- lib/rails_execution/config.rb
Constant Summary collapse
- DEFAULT_PER_PAGE =
20
- DEFAULT_FILE_TYPES =
{ '.png': 'image/png', '.gif': 'image/gif', '.jpg': 'image/jpg', '.jpeg': 'image/jpeg', '.pdf': 'application/pdf', '.csv': ['text/csv', 'text/plain'], }
Instance Attribute Summary collapse
-
#acceptable_file_types ⇒ Object
Returns the value of attribute acceptable_file_types.
-
#file_reader ⇒ Object
Returns the value of attribute file_reader.
-
#file_upload ⇒ Object
Advanced.
-
#file_uploader ⇒ Object
Returns the value of attribute file_uploader.
-
#logging ⇒ Object
Logger.
-
#logging_files ⇒ Object
Returns the value of attribute logging_files.
-
#notifier ⇒ Object
Notify.
-
#owner_avatar ⇒ Object
lambda.
-
#owner_method ⇒ Object
Returns the value of attribute owner_method.
-
#owner_model ⇒ Object
Owner display.
-
#owner_name_method ⇒ Object
Returns the value of attribute owner_name_method.
-
#per_page ⇒ Object
Paging.
-
#reviewers ⇒ Object
Task control.
-
#solo_mode ⇒ Object
Solo mode without reviewing process.
-
#task_approvable ⇒ Object
lambda.
-
#task_closable ⇒ Object
lambda.
-
#task_creatable ⇒ Object
lambda.
-
#task_editable ⇒ Object
Accessible check.
-
#task_executable ⇒ Object
lambda.
Instance Method Summary collapse
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/rails_execution/config.rb', line 50 def initialize self.solo_mode = true self.owner_model = defined?(::User) ? 'User' : nil self.owner_method = :current_user self.owner_name_method = :name self.owner_avatar = ->(_) { nil } self.file_upload = false self.acceptable_file_types = DEFAULT_FILE_TYPES self.file_uploader = ::RailsExecution::Files::Uploader self.file_reader = ::RailsExecution::Files::Reader self.per_page = DEFAULT_PER_PAGE self.reviewers = -> { [] } self.task_creatable = -> (_user) { true } self.task_editable = -> (_user, _task) { true } self.task_closable = -> (_user, _task) { true } self.task_approvable = -> (_user, _task) { true } self.task_executable = -> (_user, _task) { true } self.logging = -> (_log_file, _task) { } self.logging_files = -> (_task) { [] } self.notifier = ::RailsExecution::Services::Notifier end |
Instance Attribute Details
#acceptable_file_types ⇒ Object
Returns the value of attribute acceptable_file_types.
38 39 40 |
# File 'lib/rails_execution/config.rb', line 38 def acceptable_file_types @acceptable_file_types end |
#file_reader ⇒ Object
Returns the value of attribute file_reader.
37 38 39 |
# File 'lib/rails_execution/config.rb', line 37 def file_reader @file_reader end |
#file_upload ⇒ Object
Advanced
35 36 37 |
# File 'lib/rails_execution/config.rb', line 35 def file_upload @file_upload end |
#file_uploader ⇒ Object
Returns the value of attribute file_uploader.
36 37 38 |
# File 'lib/rails_execution/config.rb', line 36 def file_uploader @file_uploader end |
#logging ⇒ Object
Logger
41 42 43 |
# File 'lib/rails_execution/config.rb', line 41 def logging @logging end |
#logging_files ⇒ Object
Returns the value of attribute logging_files.
42 43 44 |
# File 'lib/rails_execution/config.rb', line 42 def logging_files @logging_files end |
#notifier ⇒ Object
Notify
48 49 50 |
# File 'lib/rails_execution/config.rb', line 48 def notifier @notifier end |
#owner_avatar ⇒ Object
lambda
22 23 24 |
# File 'lib/rails_execution/config.rb', line 22 def owner_avatar @owner_avatar end |
#owner_method ⇒ Object
Returns the value of attribute owner_method.
20 21 22 |
# File 'lib/rails_execution/config.rb', line 20 def owner_method @owner_method end |
#owner_model ⇒ Object
Owner display
19 20 21 |
# File 'lib/rails_execution/config.rb', line 19 def owner_model @owner_model end |
#owner_name_method ⇒ Object
Returns the value of attribute owner_name_method.
21 22 23 |
# File 'lib/rails_execution/config.rb', line 21 def owner_name_method @owner_name_method end |
#per_page ⇒ Object
Paging
45 46 47 |
# File 'lib/rails_execution/config.rb', line 45 def per_page @per_page end |
#reviewers ⇒ Object
Task control
25 26 27 |
# File 'lib/rails_execution/config.rb', line 25 def reviewers @reviewers end |
#solo_mode ⇒ Object
Solo mode without reviewing process
16 17 18 |
# File 'lib/rails_execution/config.rb', line 16 def solo_mode @solo_mode end |
#task_approvable ⇒ Object
lambda
31 32 33 |
# File 'lib/rails_execution/config.rb', line 31 def task_approvable @task_approvable end |
#task_closable ⇒ Object
lambda
29 30 31 |
# File 'lib/rails_execution/config.rb', line 29 def task_closable @task_closable end |
#task_creatable ⇒ Object
lambda
30 31 32 |
# File 'lib/rails_execution/config.rb', line 30 def task_creatable @task_creatable end |
#task_editable ⇒ Object
Accessible check
28 29 30 |
# File 'lib/rails_execution/config.rb', line 28 def task_editable @task_editable end |
#task_executable ⇒ Object
lambda
32 33 34 |
# File 'lib/rails_execution/config.rb', line 32 def task_executable @task_executable end |