Module: Negroni::Configuration::Delegation
- Included in:
- Negroni
- Defined in:
- lib/negroni/configuration.rb
Overview
‘Delegation` adds methods to the including or extending class to delegate parameters to an instance of Negroni::Configuration.
Additionally, it provides a method ‘#configuration`, which is simply a lazily-instantiated instance of Negroni::Configuration.
Class Method Summary collapse
-
.config_delegator(*attrs) ⇒ Object
Create delegation method for configuration.
Instance Method Summary collapse
-
#authentication_keys ⇒ Object
Delegates ‘authentication_keys` to #configuration.
-
#case_insensitive_keys ⇒ Object
Delegates ‘case_insensitive_keys` to #configuration.
-
#configuration ⇒ Configuration
The configuration object.
-
#email_regexp ⇒ Object
Delegates ‘email_regexp` to #configuration.
-
#lock_strategy ⇒ Object
Delegates ‘lock_strategy` to #configuration.
-
#mailer_sender ⇒ Object
Delegates ‘mailer_sender` to #configuration.
-
#maximum_attempts ⇒ Object
Delegates ‘maximum_attempts` to #configuration.
-
#not_found_exception ⇒ Object
Delegates ‘not_found_exception` to #configuration.
-
#parent_controller ⇒ Object
Delegates ‘parent_controller` to #configuration.
-
#parent_mailer ⇒ Object
Delegates ‘parent_mailer` to #configuration.
-
#password_length ⇒ Object
Delegates ‘password_length` to #configuration.
-
#pepper ⇒ Object
Delegates ‘pepper` to #configuration.
-
#reset_password_keys ⇒ Object
Delegates ‘reset_password_keys` to #configuration.
-
#reset_password_within ⇒ Object
Delegates ‘reset_password_within` to #configuration.
-
#send_password_change_notification ⇒ Object
Delegates ‘send_password_change_notification` to #configuration.
-
#stretches ⇒ Object
Delegates ‘stretches` to #configuration.
-
#strip_whitespace_keys ⇒ Object
Delegates ‘strip_whitespace_keys` to #configuration.
-
#token_algorithm ⇒ Object
Delegates ‘token_algorithm` to #configuration.
-
#token_audience ⇒ Object
Delegates ‘token_audience` to #configuration.
-
#token_lifetime ⇒ Object
Delegates ‘token_lifetime` to #configuration.
-
#token_public_key ⇒ Object
Delegates ‘token_public_key` to #configuration.
-
#token_secret ⇒ Object
Delegates ‘token_secret` to #configuration.
-
#unlock_in ⇒ Object
Delegates ‘unlock_in` to #configuration.
-
#unlock_keys ⇒ Object
Delegates ‘unlock_keys` to #configuration.
-
#unlock_strategy ⇒ Object
Delegates ‘unlock_strategy` to #configuration.
Class Method Details
.config_delegator(*attrs) ⇒ Object
Create delegation method for configuration
180 181 182 183 184 185 186 187 188 189 190 191 192 |
# File 'lib/negroni/configuration.rb', line 180 def self.config_delegator(*attrs) attrs.each do |attribute| class_eval " def \#{attribute}\n configuration.\#{attribute}\n end\n\n def \#{attribute}=(new_value)\n configuration.\#{attribute} = new_value\n end\n METHOD\n end\nend\n", __FILE__, __LINE__ + 1 |
Instance Method Details
#authentication_keys ⇒ Object
Delegates ‘authentication_keys` to #configuration.
205 |
# File 'lib/negroni/configuration.rb', line 205 config_delegator :authentication_keys |
#case_insensitive_keys ⇒ Object
Delegates ‘case_insensitive_keys` to #configuration.
206 |
# File 'lib/negroni/configuration.rb', line 206 config_delegator :case_insensitive_keys |
#configuration ⇒ Configuration
The configuration object
196 197 198 |
# File 'lib/negroni/configuration.rb', line 196 def configuration @configuration ||= Configuration.new end |
#email_regexp ⇒ Object
Delegates ‘email_regexp` to #configuration.
212 |
# File 'lib/negroni/configuration.rb', line 212 config_delegator :email_regexp |
#lock_strategy ⇒ Object
Delegates ‘lock_strategy` to #configuration.
219 |
# File 'lib/negroni/configuration.rb', line 219 config_delegator :lock_strategy |
#mailer_sender ⇒ Object
Delegates ‘mailer_sender` to #configuration.
226 |
# File 'lib/negroni/configuration.rb', line 226 config_delegator :mailer_sender |
#maximum_attempts ⇒ Object
Delegates ‘maximum_attempts` to #configuration.
222 |
# File 'lib/negroni/configuration.rb', line 222 config_delegator :maximum_attempts |
#not_found_exception ⇒ Object
Delegates ‘not_found_exception` to #configuration.
211 |
# File 'lib/negroni/configuration.rb', line 211 config_delegator :not_found_exception |
#parent_controller ⇒ Object
Delegates ‘parent_controller` to #configuration.
228 |
# File 'lib/negroni/configuration.rb', line 228 config_delegator :parent_controller |
#parent_mailer ⇒ Object
Delegates ‘parent_mailer` to #configuration.
227 |
# File 'lib/negroni/configuration.rb', line 227 config_delegator :parent_mailer |
#password_length ⇒ Object
Delegates ‘password_length` to #configuration.
213 |
# File 'lib/negroni/configuration.rb', line 213 config_delegator :password_length |
#pepper ⇒ Object
Delegates ‘pepper` to #configuration.
215 |
# File 'lib/negroni/configuration.rb', line 215 config_delegator :pepper |
#reset_password_keys ⇒ Object
Delegates ‘reset_password_keys` to #configuration.
224 |
# File 'lib/negroni/configuration.rb', line 224 config_delegator :reset_password_keys |
#reset_password_within ⇒ Object
Delegates ‘reset_password_within` to #configuration.
225 |
# File 'lib/negroni/configuration.rb', line 225 config_delegator :reset_password_within |
#send_password_change_notification ⇒ Object
Delegates ‘send_password_change_notification` to #configuration.
208 |
# File 'lib/negroni/configuration.rb', line 208 config_delegator :send_password_change_notification |
#stretches ⇒ Object
Delegates ‘stretches` to #configuration.
214 |
# File 'lib/negroni/configuration.rb', line 214 config_delegator :stretches |
#strip_whitespace_keys ⇒ Object
Delegates ‘strip_whitespace_keys` to #configuration.
207 |
# File 'lib/negroni/configuration.rb', line 207 config_delegator :strip_whitespace_keys |
#token_algorithm ⇒ Object
Delegates ‘token_algorithm` to #configuration.
216 |
# File 'lib/negroni/configuration.rb', line 216 config_delegator :token_algorithm |
#token_audience ⇒ Object
Delegates ‘token_audience` to #configuration.
210 |
# File 'lib/negroni/configuration.rb', line 210 config_delegator :token_audience |
#token_lifetime ⇒ Object
Delegates ‘token_lifetime` to #configuration.
209 |
# File 'lib/negroni/configuration.rb', line 209 config_delegator :token_lifetime |
#token_public_key ⇒ Object
Delegates ‘token_public_key` to #configuration.
218 |
# File 'lib/negroni/configuration.rb', line 218 config_delegator :token_public_key |
#token_secret ⇒ Object
Delegates ‘token_secret` to #configuration.
217 |
# File 'lib/negroni/configuration.rb', line 217 config_delegator :token_secret |
#unlock_in ⇒ Object
Delegates ‘unlock_in` to #configuration.
223 |
# File 'lib/negroni/configuration.rb', line 223 config_delegator :unlock_in |
#unlock_keys ⇒ Object
Delegates ‘unlock_keys` to #configuration.
220 |
# File 'lib/negroni/configuration.rb', line 220 config_delegator :unlock_keys |
#unlock_strategy ⇒ Object
Delegates ‘unlock_strategy` to #configuration.
221 |
# File 'lib/negroni/configuration.rb', line 221 config_delegator :unlock_strategy |