Class: Sworn::Configuration
- Inherits:
-
Object
- Object
- Sworn::Configuration
- Defined in:
- lib/sworn/configuration.rb
Instance Attribute Summary collapse
-
#consumers ⇒ Object
A hash of consumer keys and their secrets.
-
#max_drift ⇒ Object
Maximum timestamp drift allowed.
-
#replay_protector ⇒ Object
A Proc that takes an OAuth options hash and returns true if the request is replayed, and false if it is not.
-
#tokens ⇒ Object
A hash of access tokens and their secrets.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
21 22 23 24 25 26 |
# File 'lib/sworn/configuration.rb', line 21 def initialize self.consumers = Hash.new self.max_drift = 30 self.tokens = Hash.new self.replay_protector = Sworn::ReplayProtector::Custom, lambda { |_| false } end |
Instance Attribute Details
#consumers ⇒ Object
A hash of consumer keys and their secrets
4 5 6 |
# File 'lib/sworn/configuration.rb', line 4 def consumers @consumers end |
#max_drift ⇒ Object
Maximum timestamp drift allowed
7 8 9 |
# File 'lib/sworn/configuration.rb', line 7 def max_drift @max_drift end |
#replay_protector ⇒ Object
A Proc that takes an OAuth options hash and returns true if the request is replayed, and false if it is not
11 12 13 |
# File 'lib/sworn/configuration.rb', line 11 def replay_protector @replay_protector end |
#tokens ⇒ Object
A hash of access tokens and their secrets
19 20 21 |
# File 'lib/sworn/configuration.rb', line 19 def tokens @tokens end |