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.



15
16
17
# File 'app/models/metasploit/model/search/operation/base.rb', line 15

def operator
  @operator
end

#valueString

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

Returns:



21
22
23
# File 'app/models/metasploit/model/search/operation/base.rb', line 21

def value
  @value
end

Instance Method Details

#operator_validvoid (private)

This method returns an undefined value.

Validates that #operator is valid



37
38
39
40
41
# File 'app/models/metasploit/model/search/operation/base.rb', line 37

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