Class: Lims::Core::Persistence::Logger::Session
- Defined in:
- lib/lims-core/persistence/logger/session.rb
Overview
Logger specific implementation of a Session.
Instance Attribute Summary collapse
-
#indent_level ⇒ Object
readonly
Returns the value of attribute indent_level.
Attributes inherited from Session
Instance Method Summary collapse
-
#initialize(*args, &block) ⇒ Session
constructor
A new instance of Session.
- #log(msg) ⇒ Object
-
#with_indent(indent = " - ", &block) ⇒ Object
Execute a block with the specified indent level indicator.
Methods inherited from Session
#<<, #delete, #dirty_key_for, #filter, find_or_create_persistor_for, #id_for, #id_for!, #manage_state, #managed?, #method_missing, model_for, model_map, model_to_name, name_to_model, pack_uuid, #pack_uuid, persistor_class_for, persistor_class_map, #persistor_for, persistor_name_for, #persistor_name_for, register_model, #save_all, #serialize, #state_for, #states_for, #transaction, #unpack_uuid, unpack_uuid, #unserialize, #with_session, #with_subsession
Constructor Details
#initialize(*args, &block) ⇒ Session
Returns a new instance of Session.
13 14 15 16 |
# File 'lib/lims-core/persistence/logger/session.rb', line 13 def initialize(*args, &block) @indent_level = "" super(*args, &block) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Lims::Core::Persistence::Session
Instance Attribute Details
#indent_level ⇒ Object (readonly)
Returns the value of attribute indent_level.
12 13 14 |
# File 'lib/lims-core/persistence/logger/session.rb', line 12 def indent_level @indent_level end |
Instance Method Details
#log(msg) ⇒ Object
18 19 20 |
# File 'lib/lims-core/persistence/logger/session.rb', line 18 def log(msg) @store.log(indent_level+msg) end |
#with_indent(indent = " - ", &block) ⇒ Object
Execute a block with the specified indent level indicator.
24 25 26 |
# File 'lib/lims-core/persistence/logger/session.rb', line 24 def with_indent(indent=" - ", &block) temporarily('@indent_level' => @indent_level+indent, &block) end |