Class: Inspec::RunData::Result

Inherits:
Struct
  • Object
show all
Includes:
HashLikeStruct
Defined in:
lib/inspec/run_data/result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashLikeStruct

#key?, #keys, #non_nil?

Constructor Details

#initialize(raw_res_data) ⇒ Result

Returns a new instance of Result.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/inspec/run_data/result.rb', line 19

def initialize(raw_res_data)
  [
    :status,              # String
    :code_desc,           # Generated test description
    :expectation_message, # a substring of code_desc
    :skip_message,        # String
    :run_time,
    :start_time,
    :resource_title,
    :resource,
    :exception,
    :backtrace,
    :message,
  ].each do |field|
    self[field] = raw_res_data[field]
  end

  self.resource_name = raw_res_data[:resource_title].instance_variable_get(:@__resource_name__)&.to_s
end

Instance Attribute Details

#backtraceObject

Returns the value of attribute backtrace

Returns:

  • (Object)

    the current value of backtrace



3
4
5
# File 'lib/inspec/run_data/result.rb', line 3

def backtrace
  @backtrace
end

#code_descObject

Returns the value of attribute code_desc

Returns:

  • (Object)

    the current value of code_desc



3
4
5
# File 'lib/inspec/run_data/result.rb', line 3

def code_desc
  @code_desc
end

#exceptionObject

Returns the value of attribute exception

Returns:

  • (Object)

    the current value of exception



3
4
5
# File 'lib/inspec/run_data/result.rb', line 3

def exception
  @exception
end

#expectation_messageObject

Returns the value of attribute expectation_message

Returns:

  • (Object)

    the current value of expectation_message



3
4
5
# File 'lib/inspec/run_data/result.rb', line 3

def expectation_message
  @expectation_message
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



3
4
5
# File 'lib/inspec/run_data/result.rb', line 3

def message
  @message
end

#resourceObject

Returns the value of attribute resource

Returns:

  • (Object)

    the current value of resource



3
4
5
# File 'lib/inspec/run_data/result.rb', line 3

def resource
  @resource
end

#resource_nameObject

Returns the value of attribute resource_name

Returns:

  • (Object)

    the current value of resource_name



3
4
5
# File 'lib/inspec/run_data/result.rb', line 3

def resource_name
  @resource_name
end

#resource_titleObject

Returns the value of attribute resource_title

Returns:

  • (Object)

    the current value of resource_title



3
4
5
# File 'lib/inspec/run_data/result.rb', line 3

def resource_title
  @resource_title
end

#run_timeObject

Returns the value of attribute run_time

Returns:

  • (Object)

    the current value of run_time



3
4
5
# File 'lib/inspec/run_data/result.rb', line 3

def run_time
  @run_time
end

#skip_messageObject

Returns the value of attribute skip_message

Returns:

  • (Object)

    the current value of skip_message



3
4
5
# File 'lib/inspec/run_data/result.rb', line 3

def skip_message
  @skip_message
end

#start_timeObject

Returns the value of attribute start_time

Returns:

  • (Object)

    the current value of start_time



3
4
5
# File 'lib/inspec/run_data/result.rb', line 3

def start_time
  @start_time
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



3
4
5
# File 'lib/inspec/run_data/result.rb', line 3

def status
  @status
end