Class: Xenon::Headers::ContentLength

Inherits:
Header
  • Object
show all
Defined in:
lib/xenon/headers/content_length.rb

Overview

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(content_length) ⇒ ContentLength

Returns a new instance of ContentLength.



10
11
12
# File 'lib/xenon/headers/content_length.rb', line 10

def initialize(content_length)
  @content_length = content_length
end

Instance Attribute Details

#content_lengthObject (readonly)

Returns the value of attribute content_length.



8
9
10
# File 'lib/xenon/headers/content_length.rb', line 8

def content_length
  @content_length
end

Class Method Details

.parse(s) ⇒ Object



14
15
16
# File 'lib/xenon/headers/content_length.rb', line 14

def self.parse(s)
  Integer(s)
end

Instance Method Details

#to_sObject



18
19
20
# File 'lib/xenon/headers/content_length.rb', line 18

def to_s
  @content_length.to_s
end