Class: Sarif::RunAutomationDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/sarif/run_automation_details.rb

Overview

Information that describes a run’s identity and role within an engineering system process.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description: nil, id: nil, guid: nil, correlation_guid: nil, properties: nil) ⇒ RunAutomationDetails

Returns a new instance of RunAutomationDetails.



8
9
10
11
12
13
14
# File 'lib/sarif/run_automation_details.rb', line 8

def initialize(description: nil, id: nil, guid: nil, correlation_guid: nil, properties: nil)
  @description = description
  @id = id
  @guid = guid
  @correlation_guid = correlation_guid
  @properties = properties
end

Instance Attribute Details

#correlation_guidObject

Returns the value of attribute correlation_guid.



6
7
8
# File 'lib/sarif/run_automation_details.rb', line 6

def correlation_guid
  @correlation_guid
end

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'lib/sarif/run_automation_details.rb', line 6

def description
  @description
end

#guidObject

Returns the value of attribute guid.



6
7
8
# File 'lib/sarif/run_automation_details.rb', line 6

def guid
  @guid
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'lib/sarif/run_automation_details.rb', line 6

def id
  @id
end

#propertiesObject

Returns the value of attribute properties.



6
7
8
# File 'lib/sarif/run_automation_details.rb', line 6

def properties
  @properties
end

Class Method Details

.from_hash(h) ⇒ Object



30
31
32
33
34
35
36
37
38
39
# File 'lib/sarif/run_automation_details.rb', line 30

def self.from_hash(h)
  return nil if h.nil?
  new(
    description: Message.from_hash(h["description"]),
    id: h["id"],
    guid: h["guid"],
    correlation_guid: h["correlationGuid"],
    properties: h["properties"]
  )
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



41
42
43
44
# File 'lib/sarif/run_automation_details.rb', line 41

def ==(other)
  return false unless other.is_a?(RunAutomationDetails)
  @description == other.description && @id == other.id && @guid == other.guid && @correlation_guid == other.correlation_guid && @properties == other.properties
end

#hashObject



48
49
50
# File 'lib/sarif/run_automation_details.rb', line 48

def hash
  [@description, @id, @guid, @correlation_guid, @properties].hash
end

#to_hObject



16
17
18
19
20
21
22
23
24
# File 'lib/sarif/run_automation_details.rb', line 16

def to_h
  h = {}
  h["description"] = @description&.to_h unless @description.nil?
  h["id"] = @id unless @id.nil?
  h["guid"] = @guid unless @guid.nil?
  h["correlationGuid"] = @correlation_guid unless @correlation_guid.nil?
  h["properties"] = @properties unless @properties.nil?
  h
end

#to_json(pretty: false) ⇒ Object



26
27
28
# File 'lib/sarif/run_automation_details.rb', line 26

def to_json(pretty: false)
  pretty ? JSON.pretty_generate(to_h) : JSON.generate(to_h)
end