Sha256: 10e6aa77aa742a05b616a57aeebc288b281037c407ad5bdb42c04c1353924d29

Contents?: true

Size: 1.13 KB

Versions: 57

Compression:

Stored size: 1.13 KB

Contents

# Translates `<name>:<value>` to the union of `platforms.name:<value>` and `targets.name:<value>` in order to support
# the `os` and `platform` operators.
class Metasploit::Model::Search::Operator::Deprecated::Platform < Metasploit::Model::Search::Operator::Group::Union
  #
  # CONSTANTS
  #

  # Formatted operators that should be part of {#children} for this union.
  FORMATTED_OPERATORS = [
      'platforms.fully_qualified_name',
      'targets.name'
  ]

  #
  # Attributes
  #

  # @!attribute [rw] name
  #   Name of this operator
  #
  #   @return [Symbol]
  attr_accessor :name

  #
  # Validations
  #

  validates :name,
            :presence => true

  #
  # Methods
  #

  # Array of `platforms.fully_qualified_name:<formatted_value>` and `targets.name:<formatted_value>` operations.
  #
  # @param formatted_value [String] value parsed from formatted operation.
  # @return [Array<Metasploit::Model::Search::Operation::Base>]
  def children(formatted_value)
    FORMATTED_OPERATORS.collect { |formatted_operator|
      association_operator = operator(formatted_operator)
      association_operator.operate_on(formatted_value)
    }
  end
end

Version data entries

57 entries across 57 versions & 1 rubygems

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