about summary refs log tree commit homepage
path: root/lib/mogilefs/mogilefs.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-11-14 14:55:41 -0800
committerEric Wong <normalperson@yhbt.net>2011-11-14 14:55:41 -0800
commitd3014a97fb97e290bcbefeeee3d015a04eb37e07 (patch)
treeef2a3ef93ef3889cb029a47d5a338eec24488600 /lib/mogilefs/mogilefs.rb
parentc5a7ef1be173875dafa4804af53e499688bd9452 (diff)
downloadmogilefs-client-d3014a97fb97e290bcbefeeee3d015a04eb37e07.tar.gz
It can be useful, yes.
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