Module: Ronin::Model::TargetsSoftware::ClassMethods

Defined in:
lib/ronin/model/targets_software.rb

Instance Method Summary collapse

Instance Method Details

#targeting_software(software, version = nil) ⇒ DataMapper::Collection

Queries all resources targeting a specific Software.

Since:

  • 1.0.0


64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/ronin/model/targets_software.rb', line 64

def targeting_software(software,version=nil)
  conditions = case software
               when Software, Hash
                 {software: software}
               else
                 {'software.name.like' => "%#{software}%"}
               end

  if version
    conditions['software.version'] = version
  end

  all(conditions)
end