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'
|
require 'rest-client'
|
||||||
|
|
||||||
class OvalStreamDataParser
|
class OvalStreamDataParser
|
||||||
attr_accessor :data, :api_url
|
attr_accessor :index_data, :api_url
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@api_url = 'https://access.redhat.com/hydra/rest/securitydata/oval'
|
@api_url = 'https://access.redhat.com/hydra/rest/securitydata/oval'
|
||||||
@data = refresh_index
|
@index_data = refresh_index
|
||||||
end
|
end
|
||||||
|
|
||||||
def refresh_index
|
def refresh_index
|
||||||
|
@ -29,25 +29,25 @@ class OvalStreamDataParser
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_stream_names
|
def list_stream_names
|
||||||
data.map do |entry|
|
index_data.map do |entry|
|
||||||
entry['stream']
|
entry['stream']
|
||||||
end.sort
|
end.sort
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_stream_urls
|
def list_stream_urls
|
||||||
data.map do |entry|
|
index_data.map do |entry|
|
||||||
entry['resourceUrl']
|
entry['resourceUrl']
|
||||||
end.sort
|
end.sort
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_stream_labels
|
def list_stream_labels
|
||||||
data.map do |entry|
|
index_data.map do |entry|
|
||||||
entry['label']
|
entry['label']
|
||||||
end.sort
|
end.sort
|
||||||
end
|
end
|
||||||
|
|
||||||
def select_stream_by_label(label)
|
def select_stream_by_label(label)
|
||||||
data.select { |json| json['label'] == label }
|
index_data.select { |json| json['label'] == label }
|
||||||
end
|
end
|
||||||
|
|
||||||
def verify_shasum
|
def verify_shasum
|
||||||
|
|
Loading…
Add table
Reference in a new issue