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.



22
23
24
25
26
27
# File 'lib/inspec/run_data/statistics.rb', line 22

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.skipped = Inspec::RunData::Statistics::Controls::Total.new(raw_stat_ctl_data[:skipped][:total])
  self.failed = Inspec::RunData::Statistics::Controls::Total.new(raw_stat_ctl_data[:failed][:total])
end

Instance Attribute Details

#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

#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