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

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

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.



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

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

Instance Method Details

#<<(value) ⇒ Object



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

def << value
	super(value.downcase)
end

#close?Boolean

Returns:

  • (Boolean)


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

def close?
	self.include?(CLOSE)
end

#keep_alive?Boolean

Returns:

  • (Boolean)


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

def keep_alive?
	self.include?(KEEP_ALIVE)
end

#upgrade?Boolean

Returns:

  • (Boolean)


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

def upgrade?
	self.include?(UPGRADE)
end