Class: Metasploit::Model::Search::Operation::Base

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

Overview

Base of all search operations that combine an #operator with the #value it is operating on. Subclasses allow validations specific to the #operator type.

Direct Known Subclasses

Association, Boolean, Date, Group::Base, Integer, Null, Set, String

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#initialize, #valid!

Constructor Details

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

Instance Attribute Details

#operatorMetasploit::Model::Search::Operator::Base

The operator operating on #value.


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

def operator
  @operator
end

#valueString

The value cast to the correct type from the formatted_value from the formatted operation.

Returns:


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

def value
  @value
end

Instance Method Details

#operator_validvoid (private)

This method returns an undefined value.

Validates that #operator is valid


34
35
36
37
38
# File 'app/models/metasploit/model/search/operation/base.rb', line 34

def operator_valid
  if operator and !operator.valid?
    errors.add(:operator, :invalid, :value => operator)
  end
end