Class: Elasticshell::Commands::SetVerb

Inherits:
Elasticshell::Command show all
Extended by:
RecognizesVerb
Includes:
RecognizesVerb
Defined in:
lib/elasticshell/commands/set_verb.rb

Constant Summary

Constants included from RecognizesVerb

RecognizesVerb::VERB_RE

Instance Attribute Summary

Attributes inherited from Elasticshell::Command

#input, #shell

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RecognizesVerb

canonicalize_verb, is_http_verb?, verb_re

Methods inherited from Elasticshell::Command

#be_connected!, #initialize

Constructor Details

This class inherits a constructor from Elasticshell::Command

Class Method Details

.matches?(input) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/elasticshell/commands/set_verb.rb', line 10

def self.matches? input
  is_http_verb?(input)
end

Instance Method Details

#evaluate!Object



14
15
16
17
18
# File 'lib/elasticshell/commands/set_verb.rb', line 14

def evaluate!
  v = canonicalize_verb(input)
  shell.verb = v
  shell.scope.verb = v
end