diff options
author | Eric Wong <normalperson@yhbt.net> | 2012-03-22 21:44:17 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2012-03-22 21:44:17 +0000 |
commit | d18a8b31a573feaec3da7ce292440eee628f464f (patch) | |
tree | 6f27ca0a4b26f04b6433c35df1c41b59b063c2ea /lib/mogilefs/mogilefs.rb | |
parent | d5718e3ebeae61409bd5e260b8355ea68685ae84 (diff) | |
download | mogilefs-client-d18a8b31a573feaec3da7ce292440eee628f464f.tar.gz |
This changes the class associated with +key+. This is _not_ the same as the "update_class" admin command which actually modifies the class itself.
Diffstat (limited to 'lib/mogilefs/mogilefs.rb')
-rw-r--r-- | lib/mogilefs/mogilefs.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/mogilefs/mogilefs.rb b/lib/mogilefs/mogilefs.rb index 75a3936..9f4f988 100644 --- a/lib/mogilefs/mogilefs.rb +++ b/lib/mogilefs/mogilefs.rb @@ -256,6 +256,14 @@ class MogileFS::MogileFS < MogileFS::Client true end + # Updates +key+ to +newclass+ + def updateclass(key, newclass) + raise MogileFS::ReadOnlyError if readonly? + + @backend.updateclass(:domain => @domain, :key => key, :class => newclass) + true + end + # Sleeps +duration+, only used for testing def sleep(duration) # :nodoc: @backend.sleep :duration => duration |