Class: Slack::Notifier::PayloadMiddleware::Base
- Inherits:
-
Object
- Object
- Slack::Notifier::PayloadMiddleware::Base
show all
- Defined in:
- lib/slack-notifier/payload_middleware/base.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(notifier, opts = {}) ⇒ Base
Returns a new instance of Base.
22
23
24
25
|
# File 'lib/slack-notifier/payload_middleware/base.rb', line 22
def initialize notifier, opts={}
@notifier = notifier
@options = self.class.default_opts.merge opts
end
|
Instance Attribute Details
#notifier ⇒ Object
Returns the value of attribute notifier.
20
21
22
|
# File 'lib/slack-notifier/payload_middleware/base.rb', line 20
def notifier
@notifier
end
|
#options ⇒ Object
Returns the value of attribute options.
20
21
22
|
# File 'lib/slack-notifier/payload_middleware/base.rb', line 20
def options
@options
end
|
Class Method Details
.default_opts ⇒ Object
15
16
17
|
# File 'lib/slack-notifier/payload_middleware/base.rb', line 15
def default_opts
@default_opts ||= {}
end
|
.middleware_name(name) ⇒ Object
7
8
9
|
# File 'lib/slack-notifier/payload_middleware/base.rb', line 7
def middleware_name name
PayloadMiddleware.register self, name.to_sym
end
|
.options(default_opts) ⇒ Object
11
12
13
|
# File 'lib/slack-notifier/payload_middleware/base.rb', line 11
def options default_opts
@default_opts = default_opts
end
|
Instance Method Details
#call(_payload = {}) ⇒ Object
27
28
29
|
# File 'lib/slack-notifier/payload_middleware/base.rb', line 27
def call _payload={}
raise NoMethodError, "method `call` not defined for class #{self.class}"
end
|