Class: Backstage::Configuration
- Inherits:
-
Object
- Object
- Backstage::Configuration
- Defined in:
- lib/backstage/configuration.rb
Instance Attribute Summary collapse
-
#admin_user_method ⇒ Object
readonly
Returns the value of attribute admin_user_method.
-
#dashboard_configs ⇒ Object
readonly
Returns the value of attribute dashboard_configs.
-
#model_names ⇒ Object
readonly
Returns the value of attribute model_names.
-
#per_page ⇒ Object
readonly
Returns the value of attribute per_page.
-
#redirect_on_failure ⇒ Object
readonly
Returns the value of attribute redirect_on_failure.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(hash) ⇒ Configuration
Returns a new instance of Configuration.
10 11 12 13 14 15 16 17 18 |
# File 'lib/backstage/configuration.rb', line 10 def initialize(hash) @admin_user_method = (hash["admin_user_method"] || "is_admin?").to_sym @redirect_on_failure = hash["redirect_on_failure"] || "/" @per_page = hash["per_page"] || 25 @model_names = hash["models"] || [] @dashboard_configs = hash["dashboards"] || [] validate! end |
Instance Attribute Details
#admin_user_method ⇒ Object (readonly)
Returns the value of attribute admin_user_method.
7 8 9 |
# File 'lib/backstage/configuration.rb', line 7 def admin_user_method @admin_user_method end |
#dashboard_configs ⇒ Object (readonly)
Returns the value of attribute dashboard_configs.
7 8 9 |
# File 'lib/backstage/configuration.rb', line 7 def dashboard_configs @dashboard_configs end |
#model_names ⇒ Object (readonly)
Returns the value of attribute model_names.
7 8 9 |
# File 'lib/backstage/configuration.rb', line 7 def model_names @model_names end |
#per_page ⇒ Object (readonly)
Returns the value of attribute per_page.
7 8 9 |
# File 'lib/backstage/configuration.rb', line 7 def per_page @per_page end |
#redirect_on_failure ⇒ Object (readonly)
Returns the value of attribute redirect_on_failure.
7 8 9 |
# File 'lib/backstage/configuration.rb', line 7 def redirect_on_failure @redirect_on_failure end |