Sha256: 80f1d1001846f091ddf2f967b3bc20b635ad6b719d6d01386dd0e3190a9c4c07

Contents?: true

Size: 1.02 KB

Versions: 60

Compression:

Stored size: 1.02 KB

Contents

# Base of all search operations that combine an {#operator} with the {#value} it is operating on.  Subclasses allow
# validations specific to the {#operator} {Metasploit::Model::Search::Operator::Single#type type}.
class Metasploit::Model::Search::Operation::Base < Metasploit::Model::Base
  #
  # Attributes
  #

  # @!attribute [rw] operator
  #   The operator operating on {#value}.
  #
  #   @return [Metasploit::Model::Search::Operator::Base]
  attr_accessor :operator

  # @!attribute [rw] value
  #   The value cast to the correct type from the formatted_value from the formatted operation.
  #
  #   @return [String]
  attr_accessor :value

  #
  # Validations
  #

  validates :operator,
            :presence => true
  # validate_associated is defined by ActiveRecord, so have to do it manually here.
  validate :operator_valid

  private

  # Validates that {#operator} is valid
  #
  # @return [void]
  def operator_valid
    if operator and !operator.valid?
      errors.add(:operator, :invalid, :value => operator)
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
metasploit-model-5.0.2 app/models/metasploit/model/search/operation/base.rb
metasploit-model-5.0.1 app/models/metasploit/model/search/operation/base.rb
metasploit-model-5.0.0 app/models/metasploit/model/search/operation/base.rb
metasploit-model-4.0.6 app/models/metasploit/model/search/operation/base.rb
metasploit-model-4.0.5 app/models/metasploit/model/search/operation/base.rb
metasploit-model-4.0.4 app/models/metasploit/model/search/operation/base.rb
metasploit-model-4.0.3 app/models/metasploit/model/search/operation/base.rb
metasploit-model-4.0.2 app/models/metasploit/model/search/operation/base.rb
metasploit-model-4.0.1 app/models/metasploit/model/search/operation/base.rb
metasploit-model-4.0.0 app/models/metasploit/model/search/operation/base.rb
metasploit-model-3.1.4 app/models/metasploit/model/search/operation/base.rb
metasploit-model-3.1.3 app/models/metasploit/model/search/operation/base.rb
metasploit-model-3.1.2 app/models/metasploit/model/search/operation/base.rb
metasploit-model-3.1.1 app/models/metasploit/model/search/operation/base.rb
metasploit-model-3.1.0 app/models/metasploit/model/search/operation/base.rb
metasploit-model-3.0.0 app/models/metasploit/model/search/operation/base.rb
metasploit-model-2.0.4 app/models/metasploit/model/search/operation/base.rb
metasploit-model-2.0.3 app/models/metasploit/model/search/operation/base.rb
metasploit-model-2.0.2 app/models/metasploit/model/search/operation/base.rb
metasploit-model-2.0.1 app/models/metasploit/model/search/operation/base.rb