Class: Inspec::RunData::Profile::Group

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

Overview

Good candidate for keyword_init, but that is not in 2.4

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashLikeStruct

#key?, #keys, #non_nil?

Constructor Details

#initialize(raw_grp_data) ⇒ Group

Returns a new instance of Group.



79
80
81
82
# File 'lib/inspec/run_data/profile.rb', line 79

def initialize(raw_grp_data)
  %i{title id}.each { |f| self[f] = raw_grp_data[f] }
  [:controls].each { |f| self[f] = raw_grp_data[f] || [] }
end

Instance Attribute Details

#controlsObject

Returns the value of attribute controls

Returns:

  • (Object)

    the current value of controls



75
76
77
# File 'lib/inspec/run_data/profile.rb', line 75

def controls
  @controls
end

#idObject

Returns the value of attribute id

Returns:

  • (Object)

    the current value of id



75
76
77
# File 'lib/inspec/run_data/profile.rb', line 75

def id
  @id
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



75
76
77
# File 'lib/inspec/run_data/profile.rb', line 75

def title
  @title
end