Class: Adalog::SimpleLoggingAdapter::Base
- Inherits:
-
Object
- Object
- Adalog::SimpleLoggingAdapter::Base
- Defined in:
- lib/adalog/simple_logging_adapter.rb
Instance Attribute Summary collapse
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#service_name ⇒ Object
readonly
Returns the value of attribute service_name.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args, **kwargs, &block) ⇒ Base
constructor
A new instance of Base.
-
#method_missing(msg, *args, &block) ⇒ Object
TODO: Record something w.r.t.
Constructor Details
#initialize(*args, **kwargs, &block) ⇒ Base
Returns a new instance of Base.
21 22 23 24 |
# File 'lib/adalog/simple_logging_adapter.rb', line 21 def initialize(*args, **kwargs, &block) @service_name = self.class.service_name @repo = self.class.repo end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(msg, *args, &block) ⇒ Object
TODO: Record something w.r.t. whether or not a block is given?
28 29 30 31 32 33 |
# File 'lib/adalog/simple_logging_adapter.rb', line 28 def method_missing(msg, *args, &block) repo.insert( title: service_name, message: msg, details: args) end |
Instance Attribute Details
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
19 20 21 |
# File 'lib/adalog/simple_logging_adapter.rb', line 19 def repo @repo end |
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
19 20 21 |
# File 'lib/adalog/simple_logging_adapter.rb', line 19 def service_name @service_name end |
Class Method Details
.repo ⇒ Object
16 |
# File 'lib/adalog/simple_logging_adapter.rb', line 16 def repo ; @repo ; end |
.service_name ⇒ Object
15 |
# File 'lib/adalog/simple_logging_adapter.rb', line 15 def service_name; @service_name ; end |