Class: DataMapper::IdentityMaps
- Inherits:
-
Object
- Object
- DataMapper::IdentityMaps
- Defined in:
- lib/rack_datamapper/identity_maps.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, name = :default) ⇒ IdentityMaps
constructor
A new instance of IdentityMaps.
Constructor Details
#initialize(app, name = :default) ⇒ IdentityMaps
Returns a new instance of IdentityMaps.
3 4 5 6 |
# File 'lib/rack_datamapper/identity_maps.rb', line 3 def initialize(app, name = :default) @app = app @name = name.to_sym end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 |
# File 'lib/rack_datamapper/identity_maps.rb', line 8 def call(env) DataMapper.repository(@name) do @app.call(env) end end |