Class: Waylon::Conditions::Default
- Inherits:
-
Waylon::Condition
- Object
- Waylon::Condition
- Waylon::Conditions::Default
- Defined in:
- lib/waylon/conditions/default.rb
Overview
A pre-made catch-all condition for denying access
Instance Attribute Summary
Attributes inherited from Waylon::Condition
Instance Method Summary collapse
-
#initialize(*_args) ⇒ Default
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) ⇒ Default
Overrides normal Condition initialization to force a specific action
8 9 10 11 12 13 |
# File 'lib/waylon/conditions/default.rb', line 8 def initialize(*_args) # rubocop:disable Lint/MissingSuper @mechanism = nil @action = :unknown @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/default.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/default.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/default.rb', line 29 def tokens(input) [input] end |