class Alerty::Plugin::File
Public Class Methods
new(config)
click to toggle source
# File lib/alerty/plugin/file.rb, line 6 def initialize(config) raise ConfigError.new('file: path is not configured') unless config.path @path = config.path end
Public Instance Methods
alert(record)
click to toggle source
# File lib/alerty/plugin/file.rb, line 11 def alert(record) ::File.open(@path, 'a') do |io| io.puts record.to_json end end