Class: Protocol::HTTP::Header::Connection

Inherits:
Split
  • Object
show all
Defined in:
lib/protocol/http/header/connection.rb

Overview

Header value which is split by newline charaters (e.g. cookies).

Constant Summary collapse

KEEP_ALIVE =
'keep-alive'
CLOSE =
'close'
UPGRADE =
'upgrade'

Constants inherited from Split

Split::COMMA

Instance Method Summary collapse

Methods inherited from Split

#to_s

Constructor Details

#initialize(value) ⇒ Connection

Returns a new instance of Connection.



34
35
36
# File 'lib/protocol/http/header/connection.rb', line 34

def initialize(value)
	super(value.downcase)
end

Instance Method Details

#<<(value) ⇒ Object



38
39
40
# File 'lib/protocol/http/header/connection.rb', line 38

def << value
	super(value.downcase)
end

#close?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/protocol/http/header/connection.rb', line 46

def close?
	self.include?(CLOSE)
end

#keep_alive?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/protocol/http/header/connection.rb', line 42

def keep_alive?
	self.include?(KEEP_ALIVE)
end

#upgrade?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/protocol/http/header/connection.rb', line 50

def upgrade?
	self.include?(UPGRADE)
end