Class: Jellyfish::ChunkedBody

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/jellyfish/chunked_body.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(&body) ⇒ ChunkedBody

Returns a new instance of ChunkedBody.



8
9
10
# File 'lib/jellyfish/chunked_body.rb', line 8

def initialize &body
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



7
8
9
# File 'lib/jellyfish/chunked_body.rb', line 7

def body
  @body
end

Instance Method Details

#each(&block) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/jellyfish/chunked_body.rb', line 12

def each &block
  if block
    body.call(block)
  else
    to_enum(:each)
  end
end