Class: Protocol::HTTP::Headers::Split

Inherits:
Array
  • Object
show all
Defined in:
lib/protocol/http/headers.rb

Overview

Header value which is split by commas.

Constant Summary collapse

COMMA =
/\s*,\s*/

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Split

Returns a new instance of Split.



31
32
33
# File 'lib/protocol/http/headers.rb', line 31

def initialize(value)
	super(value.split(COMMA))
end

Instance Method Details

#<<(value) ⇒ Object



35
36
37
# File 'lib/protocol/http/headers.rb', line 35

def << value
	self.push(*value.split(COMMA))
end

#to_sObject



39
40
41
# File 'lib/protocol/http/headers.rb', line 39

def to_s
	join(", ")
end