Class: Booth::Syntaxes::Scope
- Inherits:
-
Object
- Object
- Booth::Syntaxes::Scope
- Includes:
- Logging, Calls
- Defined in:
- lib/booth/syntaxes/scope.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#regexp ⇒ Object
Same convention as a Ruby variable name.
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/booth/syntaxes/scope.rb', line 11 def call if regexp.match(input.to_s) return Tron.success(:valid_scope_syntax, normalized_scope: input.to_sym) end raise ::Booth::Errors::InvalidScopeSyntax, input end |
#regexp ⇒ Object
Same convention as a Ruby variable name.
20 21 22 |
# File 'lib/booth/syntaxes/scope.rb', line 20 def regexp /\A[a-z]{1}[a-z0-9_]{0,40}[a-z0-9]{1}\z/ end |