class Slack::Notifier::Config
Public Class Methods
new()
click to toggle source
# File lib/slack-notifier/config.rb, line 6 def initialize @http_client = Util::HTTPClient @defaults = {} @middleware = %i[ format_message format_attachments at channels ] end
Public Instance Methods
defaults(new_defaults=nil)
click to toggle source
# File lib/slack-notifier/config.rb, line 24 def defaults new_defaults=nil return @defaults if new_defaults.nil? raise ArgumentError, "the defaults must be a Hash" unless new_defaults.is_a?(Hash) @defaults = new_defaults end
http_client(client=nil)
click to toggle source
# File lib/slack-notifier/config.rb, line 17 def http_client client=nil return @http_client if client.nil? raise ArgumentError, "the http client must respond to ::post" unless client.respond_to?(:post) @http_client = client end
middleware(*args)
click to toggle source
# File lib/slack-notifier/config.rb, line 31 def middleware *args return @middleware if args.empty? @middleware = if args.length == 1 && args.first.is_a?(Array) || args.first.is_a?(Hash) args.first else args end end