Class: Metasploit::Model::Search::Operator::Association

Inherits:
Base
  • Object
show all
Defined in:
app/models/metasploit/model/search/operator/association.rb

Overview

A search operator declared with search_association.

Instance Attribute Summary collapse

Attributes inherited from Base

#klass

Instance Method Summary collapse

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

#associationSymbol

The association on which #source_operator was declared.

Returns:

  • (Symbol)

    association on klass.


12
13
14
# File 'app/models/metasploit/model/search/operator/association.rb', line 12

def association
  @association
end

#source_operatorMetasploit::Model::Search::Operator::Base

The operator as declared on the #association class.


18
19
20
# File 'app/models/metasploit/model/search/operator/association.rb', line 18

def source_operator
  @source_operator
end

Instance Method Details

#nameString

The name of this operator.

Returns:

  • (String)

    .


37
38
39
# File 'app/models/metasploit/model/search/operator/association.rb', line 37

def name
  @name ||= "#{association}.#{source_operator.name}".to_sym
end

#operate_on(formatted_value) ⇒ Metasploit::Model::Search::Operation::Association

Creates a Metasploit::Model::Search::Operation::Association to wrap the original operation returned by #source_operator's #operate_on.

Parameters:

Returns:


47
48
49
50
51
52
# File 'app/models/metasploit/model/search/operator/association.rb', line 47

def operate_on(formatted_value)
  Metasploit::Model::Search::Operation::Association.new(
      operator: self,
      source_operation: source_operator.operate_on(formatted_value)
  )
end