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.
290
291
292
|
# File 'lib/taskr/models.rb', line 290
def initialize(action)
@action = action
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, data) ⇒ Object
294
295
296
|
# File 'lib/taskr/models.rb', line 294
def method_missing(method, data)
LogEntry.send(method, @action, "#{"#{@progname}: " unless @progname.blank?}#{data}")
end
|
Instance Method Details
#progname ⇒ Object
302
303
304
|
# File 'lib/taskr/models.rb', line 302
def progname
action.task.name
end
|
#progname=(p) ⇒ Object
306
307
|
# File 'lib/taskr/models.rb', line 306
def progname=(p)
end
|
#respond_to?(method) ⇒ Boolean
298
299
300
|
# File 'lib/taskr/models.rb', line 298
def respond_to?(method)
[:debug, :info, :warn, :error].include?(method)
end
|