Class: Security::ReportSchemaVersionMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/security/report_schema_version_matcher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(report_declared_version:, supported_versions:) ⇒ ReportSchemaVersionMatcher

Returns a new instance of ReportSchemaVersionMatcher.



4
5
6
7
# File 'lib/security/report_schema_version_matcher.rb', line 4

def initialize(report_declared_version:, supported_versions:)
  @report_version = Gem::Version.new(report_declared_version)
  @supported_versions = supported_versions.sort.map { |version| Gem::Version.new(version) }
end

Instance Attribute Details

#report_versionObject (readonly)

Returns the value of attribute report_version.



9
10
11
# File 'lib/security/report_schema_version_matcher.rb', line 9

def report_version
  @report_version
end

#supported_versionsObject (readonly)

Returns the value of attribute supported_versions.



9
10
11
# File 'lib/security/report_schema_version_matcher.rb', line 9

def supported_versions
  @supported_versions
end

Instance Method Details

#callObject



11
12
13
# File 'lib/security/report_schema_version_matcher.rb', line 11

def call
  find_matching_versions
end