about summary refs log tree commit homepage
path: root/lib/mogilefs/mogilefs.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mogilefs/mogilefs.rb')
-rw-r--r--lib/mogilefs/mogilefs.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/mogilefs/mogilefs.rb b/lib/mogilefs/mogilefs.rb
index 8349429..8cda438 100644
--- a/lib/mogilefs/mogilefs.rb
+++ b/lib/mogilefs/mogilefs.rb
@@ -291,12 +291,24 @@ class MogileFS::MogileFS < MogileFS::Client
   end
 
   # Return metadata about a file as a hash.
-  # Returns the domain, class, expected length, devcount, etc.
-  # Optionally device ids (not paths) can be returned as
+  # Returns the domain, class, length, devcount, etc. as keys.
+  # Optionally, device ids (not paths) can be returned as
   # well if :devices is specified and +true+.
   #
   # This should only be used for informational purposes, and not usually
   # for dynamically serving files.
+  #
+  #   mg.file_info("bar")
+  #
+  # Returns:
+  #
+  #   {
+  #     "domain" => "foo",
+  #     "key" => "bar",
+  #     "class" => "default",
+  #     "devcount" => 2,
+  #     "length => 666
+  #   }
   def file_info(key, args = nil)
     opts = { :domain => @domain, :key => key }
     args and devices = args[:devices] and opts[:devices] = devices ? 1 : 0