Class: Protocol::HTTP::Header::Split
- Inherits:
-
Array
- Object
- Array
- Protocol::HTTP::Header::Split
- Defined in:
- lib/protocol/http/header/split.rb
Overview
Header value which is split by commas.
Direct Known Subclasses
Constant Summary collapse
- COMMA =
/\s*,\s*/
Instance Method Summary collapse
- #<<(value) ⇒ Object
-
#initialize(value) ⇒ Split
constructor
A new instance of Split.
- #to_s ⇒ Object
Constructor Details
#initialize(value) ⇒ Split
Returns a new instance of Split.
13 14 15 16 17 18 19 |
# File 'lib/protocol/http/header/split.rb', line 13 def initialize(value) if value super(value.split(COMMA)) else super([]) end end |
Instance Method Details
#<<(value) ⇒ Object
21 22 23 |
# File 'lib/protocol/http/header/split.rb', line 21 def << value self.push(*value.split(COMMA)) end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/protocol/http/header/split.rb', line 25 def to_s join(",") end |