Class: MetasploitDataModels::Search::Operation::Range

Inherits:
Metasploit::Model::Search::Operation::Base
  • Object
show all
Defined in:
app/models/metasploit_data_models/search/operation/range.rb

Overview

Search operation on a Range.

Direct Known Subclasses

Port::Range

Constant Summary collapse

SEPARATOR =

Separates beginning from end of the range.

'-'

Instance Method Summary collapse

Instance Method Details

#value=(formatted_value) ⇒ Range<String>

Sets #value to a Range composed by separating formatted_value by -.

Parameters:

  • formatted_value (#to_s)

Returns:



25
26
27
28
29
30
31
32
33
34
35
# File 'app/models/metasploit_data_models/search/operation/range.rb', line 25

def value=(formatted_value)
  range_arguments = formatted_value.to_s.split(SEPARATOR, 2)

  begin
    @value = Range.new(*range_arguments)
  rescue ArgumentError
    @value = formatted_value
  end

  @value
end