Class: S3ObjectProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/s3_object_proxy.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ S3ObjectProxy

Returns a new instance of S3ObjectProxy.



7
8
9
10
# File 'lib/s3_object_proxy.rb', line 7

def initialize(options = {})
  @path = options[:path]
  initialize_s3(options)
end

Instance Attribute Details

#bucketObject (readonly)

Returns the value of attribute bucket.



5
6
7
# File 'lib/s3_object_proxy.rb', line 5

def bucket
  @bucket
end

#pathObject (readonly)

Returns the value of attribute path.



4
5
6
# File 'lib/s3_object_proxy.rb', line 4

def path
  @path
end

Class Method Details

.search(prefix, options = {}) ⇒ Object



20
21
22
23
24
# File 'lib/s3_object_proxy.rb', line 20

def self.search(prefix, options = {})
  options = load_yaml().merge(options)
  connect_to_s3(options)
  AWS::S3::Bucket.objects(options[:bucket], :prefix => prefix)
end

Instance Method Details

#urlObject



12
13
14
# File 'lib/s3_object_proxy.rb', line 12

def url
  AWS::S3::S3Object.url_for(path, bucket, :authenticated => false)
end

#valueObject



16
17
18
# File 'lib/s3_object_proxy.rb', line 16

def value
  AWS::S3::S3Object.value(path, bucket)
end