Class: S3Light::Connection::Body

Inherits:
Object
  • Object
show all
Defined in:
lib/s3-light/connection/body.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body) ⇒ Body

Returns a new instance of Body.



6
7
8
9
10
11
# File 'lib/s3-light/connection/body.rb', line 6

def initialize(body)
  @body = body
  validate_body_type!
  @size = calculate_size
  @io = to_io
end

Instance Attribute Details

#sizeObject (readonly)

Returns the value of attribute size.



13
14
15
# File 'lib/s3-light/connection/body.rb', line 13

def size
  @size
end

Instance Method Details

#read(length = nil, outbuf = nil) ⇒ Object



15
16
17
# File 'lib/s3-light/connection/body.rb', line 15

def read(length = nil, outbuf = nil)
  @io.read(length, outbuf)
end

#rewindObject



19
20
21
# File 'lib/s3-light/connection/body.rb', line 19

def rewind
  @io.rewind
end