Class: Inspec::RunData::Profile

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

Defined Under Namespace

Classes: Dependency, Group, Input, Support

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from HashLikeStruct

#key?, #keys, #non_nil?

Constructor Details

#initialize(raw_prof_data) ⇒ Profile

Returns a new instance of Profile.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/inspec/run_data/profile.rb', line 24

def initialize(raw_prof_data)
  self.controls = (raw_prof_data[:controls] || []).map { |c| Inspec::RunData::Control.new(c) }
  self.depends  = (raw_prof_data[:depends]  || []).map { |d| Inspec::RunData::Profile::Dependency.new(d) }
  self.groups   = (raw_prof_data[:groups]   || []).map { |g| Inspec::RunData::Profile::Group.new(g) }
  self.inputs   = (raw_prof_data[:inputs]   || []).map { |i| Inspec::RunData::Profile::Input.new(i) }
  self.supports = (raw_prof_data[:supports] || []).map { |s| Inspec::RunData::Profile::Support.new(s) }

  %i{
    copyright
    copyright_email
    license
    maintainer
    name
    sha256
    status
    summary
    title
    version
    parent_profile
    status_message
    waiver_data
  }.each do |field|
    self[field] = raw_prof_data[field]
  end
end

Instance Attribute Details

#controlsObject

Returns the value of attribute controls

Returns:

  • (Object)

    the current value of controls



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

def controls
  @controls
end

Returns the value of attribute copyright

Returns:

  • (Object)

    the current value of copyright



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

def copyright
  @copyright
end

Returns the value of attribute copyright_email

Returns:

  • (Object)

    the current value of copyright_email



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

def copyright_email
  @copyright_email
end

#dependsObject

Returns the value of attribute depends

Returns:

  • (Object)

    the current value of depends



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

def depends
  @depends
end

#groupsObject

Returns the value of attribute groups

Returns:

  • (Object)

    the current value of groups



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

def groups
  @groups
end

#inputsObject

Returns the value of attribute inputs

Returns:

  • (Object)

    the current value of inputs



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

def inputs
  @inputs
end

#licenseObject

Returns the value of attribute license

Returns:

  • (Object)

    the current value of license



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

def license
  @license
end

#maintainerObject

Returns the value of attribute maintainer

Returns:

  • (Object)

    the current value of maintainer



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

def maintainer
  @maintainer
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



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

def name
  @name
end

#parent_profileObject

Returns the value of attribute parent_profile

Returns:

  • (Object)

    the current value of parent_profile



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

def parent_profile
  @parent_profile
end

#sha256Object

Returns the value of attribute sha256

Returns:

  • (Object)

    the current value of sha256



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

def sha256
  @sha256
end

#statusObject

Returns the value of attribute status

Returns:

  • (Object)

    the current value of status



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

def status
  @status
end

#status_messageObject

Returns the value of attribute status_message

Returns:

  • (Object)

    the current value of status_message



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

def status_message
  @status_message
end

#summaryObject

Returns the value of attribute summary

Returns:

  • (Object)

    the current value of summary



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

def summary
  @summary
end

#supportsObject

Returns the value of attribute supports

Returns:

  • (Object)

    the current value of supports



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

def supports
  @supports
end

#titleObject

Returns the value of attribute title

Returns:

  • (Object)

    the current value of title



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

def title
  @title
end

#versionObject

Returns the value of attribute version

Returns:

  • (Object)

    the current value of version



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

def version
  @version
end

#waiver_dataObject

Returns the value of attribute waiver_data

Returns:

  • (Object)

    the current value of waiver_data



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

def waiver_data
  @waiver_data
end