Module: DataMapper::S3::ClassMethods

Defined in:
lib/dm-s3.rb

Instance Method Summary collapse

Instance Method Details

#has_s3_fileObject



108
109
110
# File 'lib/dm-s3.rb', line 108

def has_s3_file
  @connector = InstanceBucketConnector.new
end

#has_s3_file_at(bucket_name) ⇒ Object

Auto-add the properties in future version



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/dm-s3.rb', line 88

def has_s3_file_at(bucket_name)
  @connector = ClassBucketConnector.new(self, bucket_name)

  class << self  
    attr_reader :connector
     
    send :define_method, :s3 do
      self.connector.s3
    end
    
    send :define_method, :bucket do            
      self.connector.bucket
    end               
  end 
  
  send :after_class_method, :inherited do |retval, subclass|
    subclass.instance_variable_set "@connector", @connector
  end                     
end