Method: RightAws::S3::Key#exists?

Defined in:
lib/s3/right_s3.rb

#exists?Boolean

Check for existence of the key in the given bucket. Returns true or false.

key = RightAws::S3::Key.create(bucket,'logs/today/1.log')
key.exists?        #=> false
key.put('Woohoo!') #=> true
key.exists?        #=> true

Returns:

  • (Boolean)


619
620
621
# File 'lib/s3/right_s3.rb', line 619

def exists?
  @bucket.key(self).last_modified ? true : false
end