Class: Procore::Auth::Stores::Memory
- Inherits:
-
Object
- Object
- Procore::Auth::Stores::Memory
- Defined in:
- lib/procore/auth/stores/memory.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Instance Method Summary collapse
- #delete ⇒ Object
- #fetch ⇒ Object
-
#initialize(key:) ⇒ Memory
constructor
A new instance of Memory.
- #save(token) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(key:) ⇒ Memory
Returns a new instance of Memory.
6 7 8 9 |
# File 'lib/procore/auth/stores/memory.rb', line 6 def initialize(key:) @key = key @store = {} end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
5 6 7 |
# File 'lib/procore/auth/stores/memory.rb', line 5 def key @key end |
#store ⇒ Object (readonly)
Returns the value of attribute store.
5 6 7 |
# File 'lib/procore/auth/stores/memory.rb', line 5 def store @store end |
Instance Method Details
#delete ⇒ Object
19 20 21 |
# File 'lib/procore/auth/stores/memory.rb', line 19 def delete @store.delete(key) end |
#fetch ⇒ Object
15 16 17 |
# File 'lib/procore/auth/stores/memory.rb', line 15 def fetch @store[key] end |
#save(token) ⇒ Object
11 12 13 |
# File 'lib/procore/auth/stores/memory.rb', line 11 def save(token) @store[key] = token end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/procore/auth/stores/memory.rb', line 23 def to_s "Memory, Key: #{key}" end |