Class: RailsMFA::Configuration
- Inherits:
-
Object
- Object
- RailsMFA::Configuration
- Defined in:
- lib/rails_mfa/configuration.rb
Instance Attribute Summary collapse
-
#code_expiry_seconds ⇒ Object
Returns the value of attribute code_expiry_seconds.
-
#code_length ⇒ Object
Returns the value of attribute code_length.
-
#email_provider ⇒ Object
Returns the value of attribute email_provider.
-
#sms_provider ⇒ Object
Returns the value of attribute sms_provider.
-
#token_store ⇒ Object
Returns the value of attribute token_store.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/rails_mfa/configuration.rb', line 7 def initialize # These lambdas are defined by the host app @sms_provider = nil # -> lambda: ->(to, message) { ... } @email_provider = nil # -> lambda: ->(to, subject, body) { ... } # Use Rails.cache by default if Rails is loaded @token_store = defined?(Rails) && Rails.respond_to?(:cache) ? Rails.cache : SimpleStore.new @code_expiry_seconds = 300 # 5 minutes @code_length = 6 end |
Instance Attribute Details
#code_expiry_seconds ⇒ Object
Returns the value of attribute code_expiry_seconds.
5 6 7 |
# File 'lib/rails_mfa/configuration.rb', line 5 def code_expiry_seconds @code_expiry_seconds end |
#code_length ⇒ Object
Returns the value of attribute code_length.
5 6 7 |
# File 'lib/rails_mfa/configuration.rb', line 5 def code_length @code_length end |
#email_provider ⇒ Object
Returns the value of attribute email_provider.
5 6 7 |
# File 'lib/rails_mfa/configuration.rb', line 5 def email_provider @email_provider end |
#sms_provider ⇒ Object
Returns the value of attribute sms_provider.
5 6 7 |
# File 'lib/rails_mfa/configuration.rb', line 5 def sms_provider @sms_provider end |
#token_store ⇒ Object
Returns the value of attribute token_store.
5 6 7 |
# File 'lib/rails_mfa/configuration.rb', line 5 def token_store @token_store end |