Class: Fernet::Configuration
- Inherits:
-
Object
- Object
- Fernet::Configuration
- Includes:
- Singleton
- Defined in:
- lib/fernet/configuration.rb
Instance Attribute Summary collapse
-
#encrypt ⇒ Object
Whether to encrypt the payload (true or false).
-
#enforce_ttl ⇒ Object
Whether to enforce a message TTL (true or false).
-
#ttl ⇒ Object
How long messages are considered valid to the verifier (an integer in seconds).
Class Method Summary collapse
- .method_missing(method) ⇒ Object
- .respond_to?(method) ⇒ Boolean
- .run {|self.instance| ... } ⇒ Object
Instance Attribute Details
#encrypt ⇒ Object
Whether to encrypt the payload (true or false)
16 17 18 |
# File 'lib/fernet/configuration.rb', line 16 def encrypt @encrypt end |
#enforce_ttl ⇒ Object
Whether to enforce a message TTL (true or false)
8 9 10 |
# File 'lib/fernet/configuration.rb', line 8 def enforce_ttl @enforce_ttl end |
#ttl ⇒ Object
How long messages are considered valid to the verifier (an integer in seconds)
12 13 14 |
# File 'lib/fernet/configuration.rb', line 12 def ttl @ttl end |
Class Method Details
.method_missing(method) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/fernet/configuration.rb', line 26 def method_missing(method) if self.instance.respond_to?(method) self.instance.send(method) else super end end |
.respond_to?(method) ⇒ Boolean
34 35 36 |
# File 'lib/fernet/configuration.rb', line 34 def respond_to?(method) self.instance.respond_to?(method) || super end |
.run {|self.instance| ... } ⇒ Object
18 19 20 21 22 23 |
# File 'lib/fernet/configuration.rb', line 18 def self.run self.instance.enforce_ttl = true self.instance.ttl = 60 self.instance.encrypt = true yield self.instance if block_given? end |