Class: Mclone::VolumeSet

Inherits:
ObjectSet show all
Defined in:
lib/mclone.rb

Instance Method Summary collapse

Methods inherited from ObjectSet

#<<, #>>, #[], #commit!, #each, #each_id, #empty?, #eql?, #hash, #id, #initialize, #merge!, #modified?, #object, #size

Constructor Details

This class inherits a constructor from Mclone::ObjectSet

Instance Method Details

#resolve(id) ⇒ Object



484
485
486
487
488
489
490
# File 'lib/mclone.rb', line 484

def resolve(id)
  case (ids = super).size
  when 0 then raise(Volume::Error, %(no volume matching "#{id}" pattern found))
  when 1 then ids.first
  else raise(Volume::Error, %(ambiguous "#{id}" pattern: two or more volumes match))
  end
end