Class: HTTP::Security::Headers::Pragma

Inherits:
Object
  • Object
show all
Defined in:
lib/http/security/headers/pragma.rb

Instance Method Summary collapse

Constructor Details

#initialize(directives = {}) ⇒ Pragma

Returns a new instance of Pragma.



6
7
8
# File 'lib/http/security/headers/pragma.rb', line 6

def initialize(directives={})
  @no_cache = directives[:no_cache]
end

Instance Method Details

#no_cache?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/http/security/headers/pragma.rb', line 10

def no_cache?
  !!@no_cache
end

#to_sObject



14
15
16
17
18
19
# File 'lib/http/security/headers/pragma.rb', line 14

def to_s
  str = ''
  str << 'no-cache' if @no_cache

  return str
end