Class: Protocol::HTTP::Header::Split

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

Overview

Header value which is split by commas.

Direct Known Subclasses

CacheControl, Connection, ETags, Vary

Constant Summary collapse

COMMA =
/\s*,\s*/

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Split

Returns a new instance of Split.


30
31
32
# File 'lib/protocol/http/header/split.rb', line 30

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

Instance Method Details

#<<(value) ⇒ Object


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

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

#to_sObject


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

def to_s
	join(", ")
end