Class: HrLite::Configuration
- Inherits:
-
Object
- Object
- HrLite::Configuration
- Defined in:
- lib/hr_lite/configuration.rb
Overview
All host integration points. Every attribute has a working default so the engine boots in any Rails app; a real host overrides what it needs in an initializer. See README for the full annotated example.
Instance Attribute Summary collapse
-
#admin_check ⇒ Object
Returns the value of attribute admin_check.
-
#authenticate_method ⇒ Object
Returns the value of attribute authenticate_method.
-
#back_link ⇒ Object
Returns the value of attribute back_link.
-
#company ⇒ Object
Returns the value of attribute company.
-
#currency_symbol ⇒ Object
Returns the value of attribute currency_symbol.
-
#current_user_method ⇒ Object
Returns the value of attribute current_user_method.
-
#display_name_method ⇒ Object
Returns the value of attribute display_name_method.
-
#employees_scope ⇒ Object
Returns the value of attribute employees_scope.
-
#extra_stylesheets ⇒ Object
Returns the value of attribute extra_stylesheets.
-
#leadership_check ⇒ Object
Returns the value of attribute leadership_check.
-
#leadership_emails ⇒ Object
Returns the value of attribute leadership_emails.
-
#mailer_from ⇒ Object
Returns the value of attribute mailer_from.
-
#mentionable_users ⇒ Object
Returns the value of attribute mentionable_users.
-
#notification_matrix ⇒ Object
Returns the value of attribute notification_matrix.
-
#notify ⇒ Object
Returns the value of attribute notify.
-
#on_designation_change ⇒ Object
Returns the value of attribute on_designation_change.
-
#parent_controller ⇒ Object
Returns the value of attribute parent_controller.
-
#public_url_base ⇒ Object
(also: #mail_link_base)
Returns the value of attribute public_url_base.
-
#render_pdf ⇒ Object
Returns the value of attribute render_pdf.
-
#time_zone ⇒ Object
Returns the value of attribute time_zone.
-
#user_class ⇒ Object
Returns the value of attribute user_class.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/hr_lite/configuration.rb', line 18 def initialize @user_class = "User" @parent_controller = "ActionController::Base" @current_user_method = :current_user @authenticate_method = :authenticate_user! @admin_check = ->(user) { user.respond_to?(:admin?) && user.admin? } @display_name_method = :display_name @employees_scope = -> { HrLite.user_klass.all } @mentionable_users = ->(query) { HrLite.default_mentionable_users(query) } @notify = ->(user:, kind:, title:, body:, path:) { } @render_pdf = nil @company = -> { { name: "Company", address: nil, logo_path: nil } } @time_zone = "Asia/Kolkata" @currency_symbol = "₹" @on_designation_change = ->(user, designation) { } @leadership_emails = [] @leadership_check = ->(user) do emails = HrLite.config.leadership_emails.map { |e| e.to_s.downcase.strip } emails.include?(user.email.to_s.downcase) end @extra_stylesheets = [] # host stylesheets linked AFTER hr_lite.css (CSS-var overrides) @mailer_from = "hr@example.com" @public_url_base = nil # e.g. "https://hr.example.com" — enables email links + HrLite.public_url @notification_matrix = nil # resolved lazily to Notifications::DEFAULT_MATRIX @back_link = nil # optional {label:, url:} for the shell nav end |
Instance Attribute Details
#admin_check ⇒ Object
Returns the value of attribute admin_check.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def admin_check @admin_check end |
#authenticate_method ⇒ Object
Returns the value of attribute authenticate_method.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def authenticate_method @authenticate_method end |
#back_link ⇒ Object
Returns the value of attribute back_link.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def back_link @back_link end |
#company ⇒ Object
Returns the value of attribute company.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def company @company end |
#currency_symbol ⇒ Object
Returns the value of attribute currency_symbol.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def currency_symbol @currency_symbol end |
#current_user_method ⇒ Object
Returns the value of attribute current_user_method.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def current_user_method @current_user_method end |
#display_name_method ⇒ Object
Returns the value of attribute display_name_method.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def display_name_method @display_name_method end |
#employees_scope ⇒ Object
Returns the value of attribute employees_scope.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def employees_scope @employees_scope end |
#extra_stylesheets ⇒ Object
Returns the value of attribute extra_stylesheets.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def extra_stylesheets @extra_stylesheets end |
#leadership_check ⇒ Object
Returns the value of attribute leadership_check.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def leadership_check @leadership_check end |
#leadership_emails ⇒ Object
Returns the value of attribute leadership_emails.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def leadership_emails @leadership_emails end |
#mailer_from ⇒ Object
Returns the value of attribute mailer_from.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def mailer_from @mailer_from end |
#mentionable_users ⇒ Object
Returns the value of attribute mentionable_users.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def mentionable_users @mentionable_users end |
#notification_matrix ⇒ Object
Returns the value of attribute notification_matrix.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def notification_matrix @notification_matrix end |
#notify ⇒ Object
Returns the value of attribute notify.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def notify @notify end |
#on_designation_change ⇒ Object
Returns the value of attribute on_designation_change.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def on_designation_change @on_designation_change end |
#parent_controller ⇒ Object
Returns the value of attribute parent_controller.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def parent_controller @parent_controller end |
#public_url_base ⇒ Object Also known as: mail_link_base
Returns the value of attribute public_url_base.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def public_url_base @public_url_base end |
#render_pdf ⇒ Object
Returns the value of attribute render_pdf.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def render_pdf @render_pdf end |
#time_zone ⇒ Object
Returns the value of attribute time_zone.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def time_zone @time_zone end |
#user_class ⇒ Object
Returns the value of attribute user_class.
6 7 8 |
# File 'lib/hr_lite/configuration.rb', line 6 def user_class @user_class end |