Class: Cyclid::API::Plugins::Log
- Defined in:
- app/cyclid/plugins/action/log.rb
Overview
“Log” plugin; will always succeed. Simply emits a message to the log.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Log
constructor
A new instance of Log.
-
#perform(log) ⇒ Object
Write the log message, with the context data interpolated.
Methods inherited from Action
Methods inherited from Base
config?, config_schema, default_config, get_config, human_name, register_plugin, set_config, update_config
Constructor Details
#initialize(args = {}) ⇒ Log
Returns a new instance of Log.
24 25 26 27 28 29 30 31 |
# File 'app/cyclid/plugins/action/log.rb', line 24 def initialize(args = {}) args.symbolize_keys! # There must be a message to log. raise 'a log action requires a message' unless args.include? :message @message = args[:message] end |
Instance Method Details
#perform(log) ⇒ Object
Write the log message, with the context data interpolated
34 35 36 37 |
# File 'app/cyclid/plugins/action/log.rb', line 34 def perform(log) log.write("#{@message ** @ctx}\n") true end |