Class: Rails::DataMapper::Middleware::IdentityMap
- Inherits:
-
Object
- Object
- Rails::DataMapper::Middleware::IdentityMap
- Defined in:
- lib/dm-rails/middleware/identity_map.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, name = :default) ⇒ IdentityMap
constructor
A new instance of IdentityMap.
Constructor Details
#initialize(app, name = :default) ⇒ IdentityMap
Returns a new instance of IdentityMap.
6 7 8 9 |
# File 'lib/dm-rails/middleware/identity_map.rb', line 6 def initialize(app, name = :default) @app = app @name = name.to_sym end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 15 |
# File 'lib/dm-rails/middleware/identity_map.rb', line 11 def call(env) ::DataMapper.repository(@name) do @app.call(env) end end |