Class: Dingding::Notifier::PayloadMiddleware::Base
- Inherits:
-
Object
- Object
- Dingding::Notifier::PayloadMiddleware::Base
- Defined in:
- lib/dingding-notifier/payload_middleware/base.rb
Direct Known Subclasses
FormatActionCard, FormatFeedCard, FormatLink, FormatMarkdown, FormatText
Instance Attribute Summary collapse
-
#notifier ⇒ Object
readonly
Returns the value of attribute notifier.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #call(_payload = {}) ⇒ Object
-
#initialize(notifier, opts = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(notifier, opts = {}) ⇒ Base
Returns a new instance of Base.
22 23 24 25 |
# File 'lib/dingding-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 (readonly)
Returns the value of attribute notifier.
20 21 22 |
# File 'lib/dingding-notifier/payload_middleware/base.rb', line 20 def notifier @notifier end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
20 21 22 |
# File 'lib/dingding-notifier/payload_middleware/base.rb', line 20 def @options end |
Class Method Details
.default_opts ⇒ Object
15 16 17 |
# File 'lib/dingding-notifier/payload_middleware/base.rb', line 15 def default_opts @default_opts ||= {} end |
.middleware_name(name) ⇒ Object
7 8 9 |
# File 'lib/dingding-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/dingding-notifier/payload_middleware/base.rb', line 11 def default_opts @default_opts = default_opts end |
Instance Method Details
#call(_payload = {}) ⇒ Object
27 28 29 |
# File 'lib/dingding-notifier/payload_middleware/base.rb', line 27 def call _payload={} raise NoMethodError, "method `call` not defined for class #{self.class}" end |