Class: WelltreatStoreFramework::RackServer
- Inherits:
-
Object
- Object
- WelltreatStoreFramework::RackServer
- Defined in:
- lib/welltreat_store_framework/rack_server.rb
Defined Under Namespace
Classes: AppObj
Instance Attribute Summary collapse
-
#app ⇒ Object
Returns the value of attribute app.
-
#partition_id ⇒ Object
Returns the value of attribute partition_id.
-
#store_name ⇒ Object
Returns the value of attribute store_name.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(store_name, partition_id) ⇒ RackServer
constructor
A new instance of RackServer.
Constructor Details
#initialize(store_name, partition_id) ⇒ RackServer
Returns a new instance of RackServer.
13 14 15 16 |
# File 'lib/welltreat_store_framework/rack_server.rb', line 13 def initialize(store_name, partition_id) self.store_name = store_name self.partition_id = partition_id end |
Instance Attribute Details
#app ⇒ Object
Returns the value of attribute app.
11 12 13 |
# File 'lib/welltreat_store_framework/rack_server.rb', line 11 def app @app end |
#partition_id ⇒ Object
Returns the value of attribute partition_id.
11 12 13 |
# File 'lib/welltreat_store_framework/rack_server.rb', line 11 def partition_id @partition_id end |
#store_name ⇒ Object
Returns the value of attribute store_name.
11 12 13 |
# File 'lib/welltreat_store_framework/rack_server.rb', line 11 def store_name @store_name end |
Instance Method Details
#call(env) ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/welltreat_store_framework/rack_server.rb', line 18 def call(env) _store = _find_store(env) WelltreatStoreFramework::Core.connect_database! if _store _store.call(env) else raise "Store - #{self.store_name} for partition - #{self.partition_id} not found." end ensure WelltreatStoreFramework::Core.disconnect_database! end |