Class: Inspec::Object::Header

Inherits:
Object
  • Object
show all
Defined in:
lib/inspec/objects/header.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(header) ⇒ Header

Returns a new instance of Header.



7
8
9
# File 'lib/inspec/objects/header.rb', line 7

def initialize(header)
  @header = header
end

Instance Attribute Details

#headerObject

Returns the value of attribute header.



5
6
7
# File 'lib/inspec/objects/header.rb', line 5

def header
  @header
end

Instance Method Details

#to_hashObject



11
12
13
14
15
# File 'lib/inspec/objects/header.rb', line 11

def to_hash
  {
    header: header,
  }
end

#to_rubyObject



17
18
19
# File 'lib/inspec/objects/header.rb', line 17

def to_ruby
  header.inspect.to_s
end

#to_sObject



21
22
23
# File 'lib/inspec/objects/header.rb', line 21

def to_s
  "Header #{header}"
end