lib/defog/handle.rb in defog-0.4.0 vs lib/defog/handle.rb in defog-0.5.0

- old
+ new

@@ -33,10 +33,14 @@ @proxy = proxy @key = key @proxy_path = Pathname.new("#{@proxy.proxy_root}/#{@key}").expand_path end + def to_s + "<#{self.class}: key=#{key}>" + end + # Returns true if the remote cloud file exists def exist? !!fog_model end @@ -70,9 +74,14 @@ opts = opts.keyword_args(:expiry => Time.now + 10*60) @proxy.fog_wrapper.url(@key, opts.expiry) end # Returns the underlying Fog::Model, should you need it for something. + # Returns nil if the model doesn't exist. + # + # If Defog::Proxy.new was passed a :prefix, the Fog::Model key and + # Defog::Handle key are related by: + # handle.fog_model.key == defog.prefix + handle.key def fog_model @proxy.fog_wrapper.fog_head(@key) end # Returns a Defog::File object, which is a specialization of ::File.