Class: Metasploit::Model::Search::Operator::Attribute

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

Overview

A search operator declared with search_attribute.

Constant Summary collapse

TYPES =

The valid types.

[
    :boolean,
    :date,
    :integer,
    {
        set: :integer
    },
    {
        set: :string
    },
    :string
]

Constants inherited from Single

Single::MODULE_SEPARATOR, Single::OPERATION_NAMESPACE_NAME

Instance Attribute Summary collapse

Attributes inherited from Base

#klass

Instance Method Summary collapse

Methods inherited from Single

constant_name, #operate_on, #operation_class, #operation_class_name

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

#attributeSymbol Also known as: name

The attribute on klass that is searchable.

Returns:

  • (Symbol)

    the attribute name



30
31
32
# File 'app/models/metasploit/model/search/operator/attribute.rb', line 30

def attribute
  @attribute
end

#typeSymbol

The type of #attribute.

Returns:

  • (Symbol)

    Value from TYPES.



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

def type
  @type
end

Instance Method Details

#attribute_setEnumerable, #include?

Set for #attribute as provided by #klass.

Returns:

  • (Enumerable, #include?)


55
56
57
# File 'app/models/metasploit/model/search/operator/attribute.rb', line 55

def attribute_set
  klass.send("#{attribute}_set")
end