just change main var name of index data
This commit is contained in:
parent
f304c79fa1
commit
04d1f267ce
1 changed files with 6 additions and 6 deletions
|
@ -4,11 +4,11 @@ require 'json'
|
|||
require 'rest-client'
|
||||
|
||||
class OvalStreamDataParser
|
||||
attr_accessor :data, :api_url
|
||||
attr_accessor :index_data, :api_url
|
||||
|
||||
def initialize
|
||||
@api_url = 'https://access.redhat.com/hydra/rest/securitydata/oval'
|
||||
@data = refresh_index
|
||||
@index_data = refresh_index
|
||||
end
|
||||
|
||||
def refresh_index
|
||||
|
@ -29,25 +29,25 @@ class OvalStreamDataParser
|
|||
end
|
||||
|
||||
def list_stream_names
|
||||
data.map do |entry|
|
||||
index_data.map do |entry|
|
||||
entry['stream']
|
||||
end.sort
|
||||
end
|
||||
|
||||
def list_stream_urls
|
||||
data.map do |entry|
|
||||
index_data.map do |entry|
|
||||
entry['resourceUrl']
|
||||
end.sort
|
||||
end
|
||||
|
||||
def list_stream_labels
|
||||
data.map do |entry|
|
||||
index_data.map do |entry|
|
||||
entry['label']
|
||||
end.sort
|
||||
end
|
||||
|
||||
def select_stream_by_label(label)
|
||||
data.select { |json| json['label'] == label }
|
||||
index_data.select { |json| json['label'] == label }
|
||||
end
|
||||
|
||||
def verify_shasum
|
||||
|
|
Loading…
Add table
Reference in a new issue