Class: Security::ReportSchemaVersionMatcher
- Inherits:
-
Object
- Object
- Security::ReportSchemaVersionMatcher
- Defined in:
- lib/security/report_schema_version_matcher.rb
Instance Attribute Summary collapse
-
#report_version ⇒ Object
readonly
Returns the value of attribute report_version.
-
#supported_versions ⇒ Object
readonly
Returns the value of attribute supported_versions.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(report_declared_version:, supported_versions:) ⇒ ReportSchemaVersionMatcher
constructor
A new instance of ReportSchemaVersionMatcher.
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_version ⇒ Object (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_versions ⇒ Object (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
#call ⇒ Object
11 12 13 |
# File 'lib/security/report_schema_version_matcher.rb', line 11 def call find_matching_versions end |