Class: ContentType::Parser::CharList
- Inherits:
-
Object
- Object
- ContentType::Parser::CharList
- Defined in:
- lib/content_type/parser.rb
Overview
:nodoc:
Instance Method Summary collapse
- #+(other) ⇒ Object
- #-(other) ⇒ Object
-
#initialize(list = nil) ⇒ CharList
constructor
A new instance of CharList.
- #size ⇒ Object
- #to_a ⇒ Object (also: #to_ary)
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(list = nil) ⇒ CharList
Returns a new instance of CharList.
12 13 14 |
# File 'lib/content_type/parser.rb', line 12 def initialize(list = nil) @list = list || yield end |
Instance Method Details
#+(other) ⇒ Object
20 21 22 |
# File 'lib/content_type/parser.rb', line 20 def +(other) CharList.new @list + other.to_a end |
#-(other) ⇒ Object
16 17 18 |
# File 'lib/content_type/parser.rb', line 16 def -(other) CharList.new @list - other.to_a end |
#size ⇒ Object
34 35 36 |
# File 'lib/content_type/parser.rb', line 34 def size to_s.size end |
#to_a ⇒ Object Also known as: to_ary
24 25 26 |
# File 'lib/content_type/parser.rb', line 24 def to_a @list.dup end |
#to_s ⇒ Object Also known as: to_str
29 30 31 |
# File 'lib/content_type/parser.rb', line 29 def to_s @list.join end |