Class: Gardefou::StorageAdapter
- Inherits:
-
Object
- Object
- Gardefou::StorageAdapter
- Defined in:
- lib/gardefou/storage.rb
Overview
Storage adapter for tracking calls (future extension point)
Instance Method Summary collapse
- #clear ⇒ Object
- #count ⇒ Object
-
#initialize ⇒ StorageAdapter
constructor
A new instance of StorageAdapter.
- #signature_exists?(signature) ⇒ Boolean
- #store_signature(signature) ⇒ Object
Constructor Details
#initialize ⇒ StorageAdapter
Returns a new instance of StorageAdapter.
38 39 40 |
# File 'lib/gardefou/storage.rb', line 38 def initialize @signatures = Set.new end |
Instance Method Details
#clear ⇒ Object
50 51 52 |
# File 'lib/gardefou/storage.rb', line 50 def clear @signatures.clear end |
#count ⇒ Object
54 55 56 |
# File 'lib/gardefou/storage.rb', line 54 def count @signatures.size end |
#signature_exists?(signature) ⇒ Boolean
46 47 48 |
# File 'lib/gardefou/storage.rb', line 46 def signature_exists?(signature) @signatures.include?(signature) end |
#store_signature(signature) ⇒ Object
42 43 44 |
# File 'lib/gardefou/storage.rb', line 42 def store_signature(signature) @signatures.add(signature) end |