Module: Desiru::API::PersistenceExtension

Included in:
GrapeIntegration, SinatraIntegration
Defined in:
lib/desiru/api/persistence_middleware.rb

Overview

Extension for API integrations to add persistence

Instance Method Summary collapse

Instance Method Details

#with_persistence(enabled: true) ⇒ Object



134
135
136
137
138
139
140
141
# File 'lib/desiru/api/persistence_middleware.rb', line 134

def with_persistence(enabled: true)
  original_app = to_rack_app

  Rack::Builder.new do
    use PersistenceMiddleware, enabled: enabled
    run original_app
  end
end