Class: Fakerclip::Writes::S3Request
- Inherits:
-
Object
- Object
- Fakerclip::Writes::S3Request
- Defined in:
- lib/fakerclip/writes.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#etag ⇒ Object
Returns the value of attribute etag.
-
#s3_bucket ⇒ Object
Returns the value of attribute s3_bucket.
-
#s3_path ⇒ Object
Returns the value of attribute s3_path.
Instance Method Summary collapse
-
#initialize(env) ⇒ S3Request
constructor
A new instance of S3Request.
Constructor Details
#initialize(env) ⇒ S3Request
Returns a new instance of S3Request.
20 21 22 23 24 25 |
# File 'lib/fakerclip/writes.rb', line 20 def initialize(env) self.body = env['rack.input'] && env['rack.input'].read || env[:body] self.s3_bucket = (env['HTTP_HOST'] || env[:host]).split('.').first self.s3_path = env['PATH_INFO'] || CGI.unescape(env[:path]) self.etag = Digest::MD5::hexdigest(body) end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
18 19 20 |
# File 'lib/fakerclip/writes.rb', line 18 def body @body end |
#etag ⇒ Object
Returns the value of attribute etag.
18 19 20 |
# File 'lib/fakerclip/writes.rb', line 18 def etag @etag end |
#s3_bucket ⇒ Object
Returns the value of attribute s3_bucket.
18 19 20 |
# File 'lib/fakerclip/writes.rb', line 18 def s3_bucket @s3_bucket end |
#s3_path ⇒ Object
Returns the value of attribute s3_path.
18 19 20 |
# File 'lib/fakerclip/writes.rb', line 18 def s3_path @s3_path end |