Class: Metasploit::Model::Search::Operator::Deprecated::Platform

Inherits:
Group::Union show all
Defined in:
app/models/metasploit/model/search/operator/deprecated/platform.rb

Overview

Translates <name>:<value> to the union of platforms.name:<value> and targets.name:<value> in order to support the os and platform operators.

Constant Summary collapse

FORMATTED_OPERATORS =

Formatted operators that should be part of #children for this union.

[
    'platforms.fully_qualified_name',
    'targets.name'
]

Instance Attribute Summary collapse

Attributes inherited from Base

#klass

Instance Method Summary collapse

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

#operator, operator_name

Methods included from Help

#help

Methods inherited from Base

#initialize, #valid!

Constructor Details

This class inherits a constructor from Metasploit::Model::Base

Instance Attribute Details

#nameSymbol

Name of this operator

Returns:

  • (Symbol)


22
23
24
# File 'app/models/metasploit/model/search/operator/deprecated/platform.rb', line 22

def name
  @name
end

Instance Method Details

#children(formatted_value) ⇒ Array<Metasploit::Model::Search::Operation::Base>

Array of platforms.fully_qualified_name:<formatted_value> and targets.name:<formatted_value> operations.

Parameters:

  • formatted_value (String)

    value parsed from formatted operation.

Returns:



39
40
41
42
43
44
# File 'app/models/metasploit/model/search/operator/deprecated/platform.rb', line 39

def children(formatted_value)
  FORMATTED_OPERATORS.collect { |formatted_operator|
    association_operator = operator(formatted_operator)
    association_operator.operate_on(formatted_value)
  }
end