Class: Excursion::Datastores::Test
- Defined in:
- lib/excursion/datastores/test.rb
Instance Attribute Summary collapse
-
#pool ⇒ Object
Returns the value of attribute pool.
Instance Method Summary collapse
- #delete(key) ⇒ Object (also: #unset)
- #read(key) ⇒ Object (also: #get)
- #write(key, value) ⇒ Object (also: #set)
Instance Attribute Details
#pool ⇒ Object
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 |