Class: Metasploit::Model::Search::Operator::Delegation
- Defined in:
- app/models/metasploit/model/search/operator/delegation.rb
Overview
An operator that delegates to another operator(s).
Direct Known Subclasses
Metasploit::Model::Search::Operator::Deprecated::App, Metasploit::Model::Search::Operator::Deprecated::Authority, Group::Base
Instance Attribute Summary
Attributes inherited from Base
Class Method Summary collapse
-
.operator_name ⇒ String
Name of this operator.
Instance Method Summary collapse
-
#name ⇒ String
Name of operator.
-
#operator(formatted_operator) ⇒ Metasploit::Model::Search::Operator::Base
protected
Finds operator with the given name on Base#klass.
Methods included from Help
Methods inherited from Base
Constructor Details
This class inherits a constructor from Metasploit::Model::Base
Class Method Details
.operator_name ⇒ String
Note:
Can't be called name
because it would alias Class#name
.
Name of this operator.
12 13 14 |
# File 'app/models/metasploit/model/search/operator/delegation.rb', line 12 def self.operator_name @operator_name ||= name.demodulize.underscore.to_sym end |
Instance Method Details
#name ⇒ String
Name of operator.
19 20 21 |
# File 'app/models/metasploit/model/search/operator/delegation.rb', line 19 def name @name ||= self.class.operator_name end |
#operator(formatted_operator) ⇒ Metasploit::Model::Search::Operator::Base (protected)
Finds operator with the given name on Base#klass.
30 31 32 33 34 35 36 37 38 39 |
# File 'app/models/metasploit/model/search/operator/delegation.rb', line 30 def operator(formatted_operator) name = formatted_operator.to_sym operator = klass.search_operator_by_name[name] unless operator raise ArgumentError, "No operator with name #{name.inspect} on #{klass}" end operator end |