module ErpTechSvcs::Config

Attributes

email_notifications_from[RW]
email_regex[RW]
file_assets_location[RW]
file_protocol[RW]
file_storage[RW]
file_upload_types[RW]
installation_domain[RW]
login_url[RW]
max_file_size_in_mb[RW]
notification_job_delay[RW]
s3_cache_expires_in_minutes[RW]
s3_protocol[RW]
s3_url[RW]
s3_url_expires_in_seconds[RW]
session_expires_in_hours[RW]

Public Class Methods

configure(&blk) click to toggle source
# File lib/erp_tech_svcs/config.rb, line 46
def configure(&blk)
  @configure_blk = blk
end
configure!() click to toggle source
# File lib/erp_tech_svcs/config.rb, line 50
def configure!
  @configure_blk.call(self) if @configure_blk
end
init!() click to toggle source
# 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 => 'notifications@noreply.com',
    :@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() click to toggle source
# File lib/erp_tech_svcs/config.rb, line 54
def installation_url
  "#{self.file_protocol}://#{self.installation_domain}"
end
reset!() click to toggle source
# File lib/erp_tech_svcs/config.rb, line 40
def reset!
  @defaults.each do |k,v|
    instance_variable_set(k,v)
  end
end