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

#call, #close, #each, #finish, #join, #read, #stream?

Constructor Details

#initialize(length) ⇒ Head

Returns a new instance of Head.



20
21
22
# File 'lib/protocol/http/body/head.rb', line 20

def initialize(length)
	@length = length
end

Class Method Details

.for(body) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/protocol/http/body/head.rb', line 12

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

Instance Method Details

#empty?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/protocol/http/body/head.rb', line 24

def empty?
	true
end

#lengthObject



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

def length
	@length
end

#ready?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/protocol/http/body/head.rb', line 28

def ready?
	true
end