Class: Taskr::Models::LogEntry::ActionLogger
- Inherits:
-
Object
- Object
- Taskr::Models::LogEntry::ActionLogger
show all
- Defined in:
- lib/taskr/models.rb
Overview
Exposes a Logger-like interface for logging entries for some particular TaskAction.
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ActionLogger.
339
340
341
|
# File 'lib/taskr/models.rb', line 339
def initialize(action)
@action = action
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, data) ⇒ Object
343
344
345
|
# File 'lib/taskr/models.rb', line 343
def method_missing(method, data)
LogEntry.send(method, @action, "#{"#{@progname}: " unless @progname.blank?}#{data}")
end
|
Instance Method Details
#progname ⇒ Object
351
352
353
|
# File 'lib/taskr/models.rb', line 351
def progname
action.task.name
end
|
#progname=(p) ⇒ Object
355
356
|
# File 'lib/taskr/models.rb', line 355
def progname=(p)
end
|
#respond_to?(method) ⇒ Boolean
347
348
349
|
# File 'lib/taskr/models.rb', line 347
def respond_to?(method)
[:debug, :info, :warn, :error].include?(method)
end
|