Method: Metasploit::Model::Search::Operator::Deprecated::Ref#children
- Defined in:
- app/models/metasploit/model/search/operator/deprecated/ref.rb
#children(formatted_value) ⇒ Array<Metasploit::Model::Search::Operation::Base>
Array of authorities.abbreviation:<formatted_value>, references.designation:<formatted_value>, and
references.url:<formatted_value>. If formatted_value contains a '-' then the portion of formatted_value
before '-' is treated is passed to authorities.abbreviation and the portion of formatted_value after '-' is
treated is passed to references.designation. If the portion of formatted_value before the '-'
case-insensitively matches 'URL', then authorities.abbreviation and references.designation is not used and the
portion of formatted_value after the '-' is passed to references.url. If any portion of the parsed
formatted_value is blank, then the corresponding child operation will not be in the returned Array.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'app/models/metasploit/model/search/operator/deprecated/ref.rb', line 14 def children(formatted_value) if formatted_value.include? '-' head, tail = formatted_value.split('-', 2) if head.casecmp('URL') == 0 # URL is not a valid abbreviation abbreviation = nil designation = nil url = tail else abbreviation = head designation = tail url = nil end else abbreviation = formatted_value designation = formatted_value url = formatted_value end operations = [] unless abbreviation.blank? operations << operator('authorities.abbreviation').operate_on(abbreviation) end unless designation.blank? operations << operator('references.designation').operate_on(designation) end unless url.blank? operations << operator('references.url').operate_on(url) end operations end |