Class: Sarif::ConfigurationOverride
- Inherits:
-
Object
- Object
- Sarif::ConfigurationOverride
- Defined in:
- lib/sarif/configuration_override.rb
Overview
Information about how a specific rule or notification was reconfigured at runtime.
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#descriptor ⇒ Object
Returns the value of attribute descriptor.
-
#properties ⇒ Object
Returns the value of attribute properties.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(configuration:, descriptor:, properties: nil) ⇒ ConfigurationOverride
constructor
A new instance of ConfigurationOverride.
- #to_h ⇒ Object
- #to_json(pretty: false) ⇒ Object
Constructor Details
#initialize(configuration:, descriptor:, properties: nil) ⇒ ConfigurationOverride
Returns a new instance of ConfigurationOverride.
8 9 10 11 12 |
# File 'lib/sarif/configuration_override.rb', line 8 def initialize(configuration:, descriptor:, properties: nil) @configuration = configuration @descriptor = descriptor @properties = properties end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
6 7 8 |
# File 'lib/sarif/configuration_override.rb', line 6 def configuration @configuration end |
#descriptor ⇒ Object
Returns the value of attribute descriptor.
6 7 8 |
# File 'lib/sarif/configuration_override.rb', line 6 def descriptor @descriptor end |
#properties ⇒ Object
Returns the value of attribute properties.
6 7 8 |
# File 'lib/sarif/configuration_override.rb', line 6 def properties @properties end |
Class Method Details
.from_hash(h) ⇒ Object
26 27 28 29 30 31 32 33 |
# File 'lib/sarif/configuration_override.rb', line 26 def self.from_hash(h) return nil if h.nil? new( configuration: ReportingConfiguration.from_hash(h["configuration"]), descriptor: ReportingDescriptorReference.from_hash(h["descriptor"]), properties: h["properties"] ) end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
35 36 37 38 |
# File 'lib/sarif/configuration_override.rb', line 35 def ==(other) return false unless other.is_a?(ConfigurationOverride) @configuration == other.configuration && @descriptor == other.descriptor && @properties == other.properties end |
#hash ⇒ Object
42 43 44 |
# File 'lib/sarif/configuration_override.rb', line 42 def hash [@configuration, @descriptor, @properties].hash end |
#to_h ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/sarif/configuration_override.rb', line 14 def to_h h = {} h["configuration"] = @configuration&.to_h h["descriptor"] = @descriptor&.to_h h["properties"] = @properties unless @properties.nil? h end |
#to_json(pretty: false) ⇒ Object
22 23 24 |
# File 'lib/sarif/configuration_override.rb', line 22 def to_json(pretty: false) pretty ? JSON.pretty_generate(to_h) : JSON.generate(to_h) end |