summaryrefslogtreecommitdiff
blob: 243cced6243c3cb083fa6a7886ed70811bafd0fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# ===GLSAMaker v2
#  Copyright (C) 2010 Alex Legler <a3li@gentoo.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# For more information, see the LICENSE file.

class Cpe < ActiveRecord::Base
  has_and_belongs_to_many :cves, :class_name => 'Cve'

  def split
    self.cpe.split(':')
  end
  
  def vendor
    split[2]
  end
  
  def product
    split[3]
  end
  
  def version
    split[4]
  end
end