Class: Inspec::RunData::Statistics::Controls

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

Defined Under Namespace

Classes: Total

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashLikeStruct

#key?, #keys, #non_nil?

Constructor Details

#initialize(raw_stat_ctl_data) ⇒ Controls

Returns a new instance of Controls.



25
26
27
28
29
30
31
32
33
# File 'lib/inspec/run_data/statistics.rb', line 25

def initialize(raw_stat_ctl_data)
  self.total = raw_stat_ctl_data[:total]
  self.passed = Inspec::RunData::Statistics::Controls::Total.new(raw_stat_ctl_data[:passed][:total])
  self.failed = Inspec::RunData::Statistics::Controls::Total.new(raw_stat_ctl_data[:failed][:total])
  self.skipped = Inspec::RunData::Statistics::Controls::Total.new(raw_stat_ctl_data[:skipped][:total]) if raw_stat_ctl_data[:skipped]
  self.not_reviewed = Inspec::RunData::Statistics::Controls::Total.new(raw_stat_ctl_data[:not_reviewed][:total]) if raw_stat_ctl_data[:not_reviewed]
  self.not_applicable = Inspec::RunData::Statistics::Controls::Total.new(raw_stat_ctl_data[:not_applicable][:total]) if raw_stat_ctl_data[:not_applicable]
  self.error = Inspec::RunData::Statistics::Controls::Total.new(raw_stat_ctl_data[:error][:total]) if raw_stat_ctl_data[:error]
end

Instance Attribute Details

#errorObject

Returns the value of attribute error

Returns:

  • (Object)

    the current value of error



15
16
17
# File 'lib/inspec/run_data/statistics.rb', line 15

def error
  @error
end

#failedObject

Returns the value of attribute failed

Returns:

  • (Object)

    the current value of failed



15
16
17
# File 'lib/inspec/run_data/statistics.rb', line 15

def failed
  @failed
end

#not_applicableObject

Returns the value of attribute not_applicable

Returns:

  • (Object)

    the current value of not_applicable



15
16
17
# File 'lib/inspec/run_data/statistics.rb', line 15

def not_applicable
  @not_applicable
end

#not_reviewedObject

Returns the value of attribute not_reviewed

Returns:

  • (Object)

    the current value of not_reviewed



15
16
17
# File 'lib/inspec/run_data/statistics.rb', line 15

def not_reviewed
  @not_reviewed
end

#passedObject

Returns the value of attribute passed

Returns:

  • (Object)

    the current value of passed



15
16
17
# File 'lib/inspec/run_data/statistics.rb', line 15

def passed
  @passed
end

#skippedObject

Returns the value of attribute skipped

Returns:

  • (Object)

    the current value of skipped



15
16
17
# File 'lib/inspec/run_data/statistics.rb', line 15

def skipped
  @skipped
end

#totalObject

Returns the value of attribute total

Returns:

  • (Object)

    the current value of total



15
16
17
# File 'lib/inspec/run_data/statistics.rb', line 15

def total
  @total
end