Class: ROM::Session::Environment
- Inherits:
-
Environment
- Object
- Environment
- ROM::Session::Environment
- Includes:
- Proxy
- Defined in:
- lib/rom/session/environment.rb
Overview
Session-specific environment wrapping ROM’s environment
It works exactly the same as ROM::Environment except it returns session relations
Class Method Summary collapse
Instance Method Summary collapse
-
#[](name) ⇒ Session::Relation
Return a relation identified by name.
- #clean? ⇒ Boolean private
- #commit ⇒ Object private
-
#initialize(environment, tracker) ⇒ Environment
constructor
private
A new instance of Environment.
Methods included from Proxy
Methods inherited from Environment
Constructor Details
#initialize(environment, tracker) ⇒ Environment
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Environment.
24 25 26 27 28 |
# File 'lib/rom/session/environment.rb', line 24 def initialize(environment, tracker) @environment = environment @tracker = tracker initialize_memory end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class ROM::Proxy
Class Method Details
.build(environment, tracker = Tracker.new) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
19 20 21 |
# File 'lib/rom/session/environment.rb', line 19 def self.build(environment, tracker = Tracker.new) new(environment, tracker) end |
Instance Method Details
#[](name) ⇒ Session::Relation
Return a relation identified by name
37 38 39 |
# File 'lib/rom/session/environment.rb', line 37 def [](name) memory[name] end |
#clean? ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
47 48 49 |
# File 'lib/rom/session/environment.rb', line 47 def clean? tracker.clean? end |
#commit ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
42 43 44 |
# File 'lib/rom/session/environment.rb', line 42 def commit tracker.commit end |