Class: Rack::BlacklistCookies::BaseScrubber

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/blacklist_cookies/scrubber.rb

Overview

The Scrubber class is responsible for removing any unwanted cookies from a given cookies header. The base class provides the main #scrub method, while the subclasses are responsible for being able to deal with parsing the Request and Response headers and associated config.

Direct Known Subclasses

RequestScrubber, ResponseScrubber

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env, cookies_header) ⇒ BaseScrubber

Returns a new instance of BaseScrubber.



10
11
12
13
# File 'lib/rack/blacklist_cookies/scrubber.rb', line 10

def initialize(env, cookies_header)
  @env = env
  @cookies_header = cookies_header
end

Instance Attribute Details

#envObject (readonly)

Returns the value of attribute env.



8
9
10
# File 'lib/rack/blacklist_cookies/scrubber.rb', line 8

def env
  @env
end

Instance Method Details

#to_sObject



15
16
17
18
# File 'lib/rack/blacklist_cookies/scrubber.rb', line 15

def to_s
  return @cookies_header unless blacklist
  scrub
end