diff options
Diffstat (limited to 'lib/glsa_repository.rb')
-rw-r--r-- | lib/glsa_repository.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/glsa_repository.rb b/lib/glsa_repository.rb index 90c9899..ee1096b 100644 --- a/lib/glsa_repository.rb +++ b/lib/glsa_repository.rb @@ -32,12 +32,21 @@ class GLSARepository @load_date = DateTime.now @advisories = advisories.freeze + @latest = advisories.keys.sort.reverse.freeze end def get @advisories end + def latest_ids + @latest + end + + def latest(n = 10) + @latest[0..n].map {|id| @advisories[id] } + end + def[](id) @advisories[id] end |