Class: Procore::Auth::Stores::Memory

Inherits:
Object
  • Object
show all
Defined in:
lib/procore/auth/stores/memory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#keyObject (readonly)

Returns the value of attribute key.



5
6
7
# File 'lib/procore/auth/stores/memory.rb', line 5

def key
  @key
end

#storeObject (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

#deleteObject



19
20
21
# File 'lib/procore/auth/stores/memory.rb', line 19

def delete
  @store.delete(key)
end

#fetchObject



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_sObject



23
24
25
# File 'lib/procore/auth/stores/memory.rb', line 23

def to_s
  "Memory, Key: #{key}"
end