Class: Rack::SimpleAuth::HMAC::Config
- Inherits:
-
Object
- Object
- Rack::SimpleAuth::HMAC::Config
- Defined in:
- lib/rack/simple_auth/hmac/config.rb
Overview
Config objects will be instantiated out of this class when using Rack::SimpleAuth::HMAC::Middleware Also the public instance attributes / virtual attributes will be populated via the Middleware DSL
Instance Attribute Summary collapse
- #logpath ⇒ String
- #request_config ⇒ Hash
-
#secret ⇒ String
Secret Attribute with nil guard.
-
#signature ⇒ String
Signature Attribute with nil guard.
-
#tolerance ⇒ Fixnum
Tolerance Attribute with nil guard.
- #verbose ⇒ TrueClass|NilClass
Instance Method Summary collapse
-
#method_missing(name, *args) ⇒ Object
Throw Runtime error for unknown attribute.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object
Throw Runtime error for unknown attribute
39 40 41 |
# File 'lib/rack/simple_auth/hmac/config.rb', line 39 def method_missing(name, *args) fail "Unknown option #{name.to_s.gsub!('=', '')}" end |
Instance Attribute Details
#logpath ⇒ String
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/rack/simple_auth/hmac/config.rb', line 26 class Config attr_writer :tolerance attr_writer :secret, :signature attr_accessor :verbose attr_accessor :logpath, :request_config ## # Throw Runtime error for unknown attribute # # @param [Symbol] name # @param [Array] args # def method_missing(name, *args) fail "Unknown option #{name.to_s.gsub!('=', '')}" end ## # Tolerance Attribute with nil guard # # @return [Fixnum] tolerance # def tolerance @tolerance || 1000 end ## # Secret Attribute with nil guard # # @return [String] secret # def secret @secret || '' end ## # Signature Attribute with nil guard # # @return [String] signature # def signature @signature || '' end end |
#request_config ⇒ Hash
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/rack/simple_auth/hmac/config.rb', line 26 class Config attr_writer :tolerance attr_writer :secret, :signature attr_accessor :verbose attr_accessor :logpath, :request_config ## # Throw Runtime error for unknown attribute # # @param [Symbol] name # @param [Array] args # def method_missing(name, *args) fail "Unknown option #{name.to_s.gsub!('=', '')}" end ## # Tolerance Attribute with nil guard # # @return [Fixnum] tolerance # def tolerance @tolerance || 1000 end ## # Secret Attribute with nil guard # # @return [String] secret # def secret @secret || '' end ## # Signature Attribute with nil guard # # @return [String] signature # def signature @signature || '' end end |
#secret ⇒ String
Secret Attribute with nil guard
57 58 59 |
# File 'lib/rack/simple_auth/hmac/config.rb', line 57 def secret @secret || '' end |
#signature ⇒ String
Signature Attribute with nil guard
66 67 68 |
# File 'lib/rack/simple_auth/hmac/config.rb', line 66 def signature @signature || '' end |
#tolerance ⇒ Fixnum
Tolerance Attribute with nil guard
48 49 50 |
# File 'lib/rack/simple_auth/hmac/config.rb', line 48 def tolerance @tolerance || 1000 end |
#verbose ⇒ TrueClass|NilClass
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/rack/simple_auth/hmac/config.rb', line 26 class Config attr_writer :tolerance attr_writer :secret, :signature attr_accessor :verbose attr_accessor :logpath, :request_config ## # Throw Runtime error for unknown attribute # # @param [Symbol] name # @param [Array] args # def method_missing(name, *args) fail "Unknown option #{name.to_s.gsub!('=', '')}" end ## # Tolerance Attribute with nil guard # # @return [Fixnum] tolerance # def tolerance @tolerance || 1000 end ## # Secret Attribute with nil guard # # @return [String] secret # def secret @secret || '' end ## # Signature Attribute with nil guard # # @return [String] signature # def signature @signature || '' end end |