Class: Sworn::ReplayProtector::Memory
- Inherits:
-
Object
- Object
- Sworn::ReplayProtector::Memory
- Defined in:
- lib/sworn/replay_protector/memory.rb
Instance Method Summary collapse
-
#initialize(*options) ⇒ Memory
constructor
A new instance of Memory.
- #replayed?(oauth) ⇒ Boolean
Constructor Details
#initialize(*options) ⇒ Memory
Returns a new instance of Memory.
4 5 6 |
# File 'lib/sworn/replay_protector/memory.rb', line 4 def initialize(*) @store ||= Set.new end |
Instance Method Details
#replayed?(oauth) ⇒ Boolean
8 9 10 11 12 |
# File 'lib/sworn/replay_protector/memory.rb', line 8 def replayed?(oauth) return true if @store.include?(oauth) @store << oauth false end |