Class: Waylon::Conditions::BlackHole
- Inherits:
-
Waylon::Condition
- Object
- Waylon::Condition
- Waylon::Conditions::BlackHole
- Defined in:
- lib/waylon/conditions/black_hole.rb
Overview
A pre-made catch-all condition for ignoring messages
Instance Attribute Summary
Attributes inherited from Waylon::Condition
Instance Method Summary collapse
-
#initialize(*_args) ⇒ BlackHole
constructor
Overrides normal Condition initialization to force a specific action.
-
#matches?(_input) ⇒ Boolean
Matches any input (since the Default route, when used, should always function).
-
#permits?(_user) ⇒ Boolean
Permits any user (since the Default route, when used, should always function).
-
#tokens(input) ⇒ Array<String>
Just provides back all input as a single token.
Methods inherited from Waylon::Condition
#mention_only?, #named_tokens, #properly_mentions?
Constructor Details
#initialize(*_args) ⇒ BlackHole
Overrides normal Condition initialization to force a specific action
8 9 10 11 12 13 |
# File 'lib/waylon/conditions/black_hole.rb', line 8 def initialize(*_args) # rubocop:disable Lint/MissingSuper @mechanism = nil @action = :ignore @allowed_groups = [:everyone] @help = "" end |
Instance Method Details
#matches?(_input) ⇒ Boolean
Matches any input (since the Default route, when used, should always function)
17 18 19 |
# File 'lib/waylon/conditions/black_hole.rb', line 17 def matches?(_input) true end |
#permits?(_user) ⇒ Boolean
Permits any user (since the Default route, when used, should always function)
23 24 25 |
# File 'lib/waylon/conditions/black_hole.rb', line 23 def permits?(_user) true end |
#tokens(input) ⇒ Array<String>
Just provides back all input as a single token
29 30 31 |
# File 'lib/waylon/conditions/black_hole.rb', line 29 def tokens(input) [input] end |