Class: Adalog::SimpleLoggingAdapter
- Inherits:
-
Object
- Object
- Adalog::SimpleLoggingAdapter
- 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.
Instance Method Summary collapse
-
#initialize(service_name, repo) ⇒ SimpleLoggingAdapter
constructor
A new instance of SimpleLoggingAdapter.
-
#method_missing(msg, *args, &block) ⇒ Object
TODO: Record something w.r.t.
Constructor Details
#initialize(service_name, repo) ⇒ SimpleLoggingAdapter
Returns a new instance of SimpleLoggingAdapter.
6 7 8 9 |
# File 'lib/adalog/simple_logging_adapter.rb', line 6 def initialize(service_name, repo) @service_name = service_name @repo = 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?
13 14 15 16 17 18 |
# File 'lib/adalog/simple_logging_adapter.rb', line 13 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.
4 5 6 |
# File 'lib/adalog/simple_logging_adapter.rb', line 4 def repo @repo end |
#service_name ⇒ Object (readonly)
Returns the value of attribute service_name.
4 5 6 |
# File 'lib/adalog/simple_logging_adapter.rb', line 4 def service_name @service_name end |