Class: Tinfoil::SecureHeader

Inherits:
Object
  • Object
show all
Defined in:
lib/tinfoil/secure_header.rb

Defined Under Namespace

Classes: Type

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ SecureHeader

Returns a new instance of SecureHeader.



13
14
15
16
17
# File 'lib/tinfoil/secure_header.rb', line 13

def initialize (name)
  @name = name
  @ignore = false
  @exists = false
end

Instance Attribute Details

#existsObject

Returns the value of attribute exists.



11
12
13
# File 'lib/tinfoil/secure_header.rb', line 11

def exists
  @exists
end

#ignoreObject

Returns the value of attribute ignore.



11
12
13
# File 'lib/tinfoil/secure_header.rb', line 11

def ignore
  @ignore
end

#nameObject

Returns the value of attribute name.



11
12
13
# File 'lib/tinfoil/secure_header.rb', line 11

def name
  @name
end

Instance Method Details

#statusObject



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/tinfoil/secure_header.rb', line 19

def status
  if @ignore
    "ignored"
  else
    if @exists
      "exists"
    else
      "missing"
    end
  end
end

#to_sObject



31
32
33
# File 'lib/tinfoil/secure_header.rb', line 31

def to_s
  "#{@name}: #{status}"
end