Class: Protocol::HTTP::Body::Head

Inherits:
Readable
  • Object
show all
Defined in:
lib/protocol/http/body/head.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Readable

#close, #each, #finish, #join, #read

Constructor Details

#initialize(length) ⇒ Head

Returns a new instance of Head.



37
38
39
# File 'lib/protocol/http/body/head.rb', line 37

def initialize(length)
  @length = length
end

Class Method Details

.for(body) ⇒ Object



29
30
31
32
33
34
35
# File 'lib/protocol/http/body/head.rb', line 29

def self.for(body)
  head = self.new(body.length)
  
  body.close
  
  return head
end

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/protocol/http/body/head.rb', line 41

def empty?
  true
end

#lengthObject



45
46
47
# File 'lib/protocol/http/body/head.rb', line 45

def length
  @length
end