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.



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

def initialize &body
  @body = body
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



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

def body
  @body
end

Instance Method Details

#each(&block) ⇒ Object



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

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