Class: Excursion::Datastores::Test

Inherits:
Datastore
  • Object
show all
Defined in:
lib/excursion/datastores/test.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#poolObject

Returns the value of attribute pool.



8
9
10
# File 'lib/excursion/datastores/test.rb', line 8

def pool
  @pool
end

Instance Method Details

#delete(key) ⇒ Object Also known as: unset



20
21
22
# File 'lib/excursion/datastores/test.rb', line 20

def delete(key)
  @pool.delete(key.to_sym)
end

#read(key) ⇒ Object Also known as: get



10
11
12
# File 'lib/excursion/datastores/test.rb', line 10

def read(key)
  @pool[key.to_sym] ||= Excursion::Pool::DummyApplication.new(key, {host: 'test.local'}, ActionDispatch::Routing::RouteSet::NamedRouteCollection.new)
end

#write(key, value) ⇒ Object Also known as: set



15
16
17
# File 'lib/excursion/datastores/test.rb', line 15

def write(key, value)
  @pool[key.to_sym] = value
end