YUKI Piro Hiroshi
null+****@clear*****
Fri Dec 12 00:43:49 JST 2014
YUKI "Piro" Hiroshi 2014-12-12 00:43:49 +0900 (Fri, 12 Dec 2014) New Revision: 2664ff676405ae8c32d9a547c549b3e957394f07 https://github.com/droonga/droonga-engine/commit/2664ff676405ae8c32d9a547c549b3e957394f07 Merged e0f9f34: Merge pull request #30 from piroor/replicas-in-a-branch Message: Remove needless suffix Modified files: lib/droonga/catalog/volume.rb Modified: lib/droonga/catalog/volume.rb (+10 -10) =================================================================== --- lib/droonga/catalog/volume.rb 2014-12-12 00:43:20 +0900 (11271a5) +++ lib/droonga/catalog/volume.rb 2014-12-12 00:43:49 +0900 (2d7e12e) @@ -21,22 +21,22 @@ module Droonga module Catalog module Volume class UnknownTypeVolume < ArgumentError - def initialize(raw_volume) + def initialize(raw) super("volume must have one of 'address', 'slices' or 'replicas': " + - "#{raw_volume.inspect}") + "#{raw.inspect}") end end class << self - def create(dataset, raw_volume) - if raw_volume.key?("address") - SingleVolume.new(raw_volume) - elsif raw_volume.key?("slices") - SlicesVolume.new(dataset, raw_volume) - elsif raw_volume.key?("replicas") - ReplicasVolume.new(dataset, raw_volume) + def create(dataset, raw) + if raw.key?("address") + SingleVolume.new(raw) + elsif raw.key?("slices") + SlicesVolume.new(dataset, raw) + elsif raw.key?("replicas") + ReplicasVolume.new(dataset, raw) else - raise UnknownTypeVolume.new(raw_volume) + raise UnknownTypeVolume.new(raw) end end end -------------- next part -------------- HTML����������������������������...ダウンロード