Class: Metasploit::Model::Search::Operator::Deprecated::Author
- Inherits:
-
Group::Union
- Object
- Base
- Base
- Metasploit::Model::Search::Operator::Delegation
- Group::Base
- Group::Union
- Metasploit::Model::Search::Operator::Deprecated::Author
- Defined in:
- app/models/metasploit/model/search/operator/deprecated/author.rb
Overview
Operator that emulates the behavior of 'author' operator that could search Mdm::Module::Detail
by making
Metasploit::Model::Search::Operation::Group::Union between authors.name
, email_addresss.domain
, and
email_addresses.local
.
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#children(formatted_value) ⇒ Array<Metasploit::Model::Search::Operation::Base>
Turns author:
into Array of authors.name: , email_addresses.domain: , and email_addresses.local: operations.
Methods inherited from Group::Base
#operate_on, operation_class, #operation_class, operation_class_name, operation_class_name!, operation_class_name=
Methods inherited from Metasploit::Model::Search::Operator::Delegation
#name, #operator, operator_name
Methods inherited from Base
Methods included from Help
Methods inherited from Base
Constructor Details
This class inherits a constructor from Metasploit::Model::Base
Instance Method Details
#children(formatted_value) ⇒ Array<Metasploit::Model::Search::Operation::Base>
Turns author:formatted_value
, then the portion of formatted_value
before the '@' is used for email_addresses.local
and the portion of formatted_value
after the '@' is used for email_addresses.domain
.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/models/metasploit/model/search/operator/deprecated/author.rb', line 14 def children(formatted_value) operations = [] = operator('authors.name') operations << .operate_on(formatted_value) if formatted_value.include? '@' local, domain = formatted_value.split('@', 2) else domain = formatted_value local = formatted_value end email_address_domain_operator = operator('email_addresses.domain') operations << email_address_domain_operator.operate_on(domain) email_addresses_local_operator = operator('email_addresses.local') operations << email_addresses_local_operator.operate_on(local) operations end |