Class: JSAdmin::Configuration
- Inherits:
-
Object
- Object
- JSAdmin::Configuration
- Defined in:
- lib/js_admin/configuration.rb
Instance Attribute Summary collapse
-
#association_limit ⇒ Object
Returns the value of attribute association_limit.
-
#basic_auth_password ⇒ Object
Returns the value of attribute basic_auth_password.
-
#basic_auth_realm ⇒ Object
Returns the value of attribute basic_auth_realm.
-
#basic_auth_username ⇒ Object
Returns the value of attribute basic_auth_username.
-
#display_name_methods ⇒ Object
Returns the value of attribute display_name_methods.
-
#excluded_models ⇒ Object
Returns the value of attribute excluded_models.
-
#included_models ⇒ Object
Returns the value of attribute included_models.
-
#records_per_page ⇒ Object
Returns the value of attribute records_per_page.
Instance Method Summary collapse
- #basic_auth_enabled? ⇒ Boolean
- #exclude_models(*models) ⇒ Object
- #include_models(*models) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/js_admin/configuration.rb', line 12 def initialize @included_models = [] @excluded_models = [] @records_per_page = 10 @association_limit = 100 @display_name_methods = %i[name title email username id] @basic_auth_username = nil @basic_auth_password = nil @basic_auth_realm = "JSAdmin" end |
Instance Attribute Details
#association_limit ⇒ Object
Returns the value of attribute association_limit.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def association_limit @association_limit end |
#basic_auth_password ⇒ Object
Returns the value of attribute basic_auth_password.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def basic_auth_password @basic_auth_password end |
#basic_auth_realm ⇒ Object
Returns the value of attribute basic_auth_realm.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def basic_auth_realm @basic_auth_realm end |
#basic_auth_username ⇒ Object
Returns the value of attribute basic_auth_username.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def basic_auth_username @basic_auth_username end |
#display_name_methods ⇒ Object
Returns the value of attribute display_name_methods.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def display_name_methods @display_name_methods end |
#excluded_models ⇒ Object
Returns the value of attribute excluded_models.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def excluded_models @excluded_models end |
#included_models ⇒ Object
Returns the value of attribute included_models.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def included_models @included_models end |
#records_per_page ⇒ Object
Returns the value of attribute records_per_page.
3 4 5 |
# File 'lib/js_admin/configuration.rb', line 3 def records_per_page @records_per_page end |
Instance Method Details
#basic_auth_enabled? ⇒ Boolean
31 32 33 |
# File 'lib/js_admin/configuration.rb', line 31 def basic_auth_enabled? basic_auth_username.to_s != "" && basic_auth_password.to_s != "" end |
#exclude_models(*models) ⇒ Object
27 28 29 |
# File 'lib/js_admin/configuration.rb', line 27 def exclude_models(*models) excluded_models.concat(normalize_model_names(models)) end |
#include_models(*models) ⇒ Object
23 24 25 |
# File 'lib/js_admin/configuration.rb', line 23 def include_models(*models) included_models.concat(normalize_model_names(models)) end |