Module: ErpTechSvcs::Config
- Defined in:
- lib/erp_tech_svcs/config.rb
Class Attribute Summary collapse
-
.email_notifications_from ⇒ Object
Returns the value of attribute email_notifications_from.
-
.email_regex ⇒ Object
Returns the value of attribute email_regex.
-
.file_assets_location ⇒ Object
Returns the value of attribute file_assets_location.
-
.file_protocol ⇒ Object
Returns the value of attribute file_protocol.
-
.file_storage ⇒ Object
Returns the value of attribute file_storage.
-
.file_upload_types ⇒ Object
Returns the value of attribute file_upload_types.
-
.installation_domain ⇒ Object
Returns the value of attribute installation_domain.
-
.login_url ⇒ Object
Returns the value of attribute login_url.
-
.max_file_size_in_mb ⇒ Object
Returns the value of attribute max_file_size_in_mb.
-
.notification_job_delay ⇒ Object
Returns the value of attribute notification_job_delay.
-
.s3_cache_expires_in_minutes ⇒ Object
Returns the value of attribute s3_cache_expires_in_minutes.
-
.s3_protocol ⇒ Object
Returns the value of attribute s3_protocol.
-
.s3_url ⇒ Object
Returns the value of attribute s3_url.
-
.s3_url_expires_in_seconds ⇒ Object
Returns the value of attribute s3_url_expires_in_seconds.
-
.session_expires_in_hours ⇒ Object
Returns the value of attribute session_expires_in_hours.
Class Method Summary collapse
- .configure(&blk) ⇒ Object
- .configure! ⇒ Object
- .init! ⇒ Object
- .installation_url ⇒ Object
- .reset! ⇒ Object
Class Attribute Details
.email_notifications_from ⇒ Object
Returns the value of attribute email_notifications_from.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def email_notifications_from @email_notifications_from end |
.email_regex ⇒ Object
Returns the value of attribute email_regex.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def email_regex @email_regex end |
.file_assets_location ⇒ Object
Returns the value of attribute file_assets_location.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def file_assets_location @file_assets_location end |
.file_protocol ⇒ Object
Returns the value of attribute file_protocol.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def file_protocol @file_protocol end |
.file_storage ⇒ Object
Returns the value of attribute file_storage.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def file_storage @file_storage end |
.file_upload_types ⇒ Object
Returns the value of attribute file_upload_types.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def file_upload_types @file_upload_types end |
.installation_domain ⇒ Object
Returns the value of attribute installation_domain.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def installation_domain @installation_domain end |
.login_url ⇒ Object
Returns the value of attribute login_url.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def login_url @login_url end |
.max_file_size_in_mb ⇒ Object
Returns the value of attribute max_file_size_in_mb.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def max_file_size_in_mb @max_file_size_in_mb end |
.notification_job_delay ⇒ Object
Returns the value of attribute notification_job_delay.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def notification_job_delay @notification_job_delay end |
.s3_cache_expires_in_minutes ⇒ Object
Returns the value of attribute s3_cache_expires_in_minutes.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def s3_cache_expires_in_minutes @s3_cache_expires_in_minutes end |
.s3_protocol ⇒ Object
Returns the value of attribute s3_protocol.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def s3_protocol @s3_protocol end |
.s3_url ⇒ Object
Returns the value of attribute s3_url.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def s3_url @s3_url end |
.s3_url_expires_in_seconds ⇒ Object
Returns the value of attribute s3_url_expires_in_seconds.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def s3_url_expires_in_seconds @s3_url_expires_in_seconds end |
.session_expires_in_hours ⇒ Object
Returns the value of attribute session_expires_in_hours.
5 6 7 |
# File 'lib/erp_tech_svcs/config.rb', line 5 def session_expires_in_hours @session_expires_in_hours end |
Class Method Details
.configure(&blk) ⇒ Object
46 47 48 |
# File 'lib/erp_tech_svcs/config.rb', line 46 def configure(&blk) @configure_blk = blk end |
.configure! ⇒ Object
50 51 52 |
# File 'lib/erp_tech_svcs/config.rb', line 50 def configure! @configure_blk.call(self) if @configure_blk end |
.init! ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/erp_tech_svcs/config.rb', line 21 def init! @defaults = { :@max_file_size_in_mb => 5, :@file_upload_types => 'txt,pdf,zip,tgz,gz,rar,jpg,jpeg,gif,png,tif,tiff,bmp,csv,xls,xlsx,doc,docx,ppt,pptx,psd,ai,css,js,mp3,mp4,m4a,m4v,mov,wav,wmv', :@installation_domain => 'localhost:3000', :@login_url => '/erp_app/login', :@email_notifications_from => '[email protected]', :@email_regex => "^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$", :@file_assets_location => 'file_assets', # relative to Rails.root/ :@s3_url_expires_in_seconds => 60, :@s3_url => ':s3_path_url', :@file_protocol => 'http', # Can be either 'http' or 'https' :@s3_protocol => 'https', # Can be either 'http' or 'https' :@file_storage => :filesystem, # Can be either :s3 or :filesystem :@session_expires_in_hours => 12, # this is used by DeleteExpiredSessionsJob to purge inactive sessions from database :@notification_job_delay => '2 minutes from now' } end |
.installation_url ⇒ Object
54 55 56 |
# File 'lib/erp_tech_svcs/config.rb', line 54 def installation_url "#{self.file_protocol}://#{self.installation_domain}" end |
.reset! ⇒ Object
40 41 42 43 44 |
# File 'lib/erp_tech_svcs/config.rb', line 40 def reset! @defaults.each do |k,v| instance_variable_set(k,v) end end |