Kouhei Sutou
null+****@clear*****
Tue Dec 20 16:10:21 JST 2016
Kouhei Sutou 2016-12-20 16:10:21 +0900 (Tue, 20 Dec 2016) New Revision: 606291e4020ce1680da97340b0b5d12a44d679db https://github.com/ranguba/groonga-client/commit/606291e4020ce1680da97340b0b5d12a44d679db Message: Add name accessors to Response::Schema#plugins Modified files: lib/groonga/client/response/schema.rb Modified: lib/groonga/client/response/schema.rb (+15 -0) =================================================================== --- lib/groonga/client/response/schema.rb 2016-12-20 15:53:02 +0900 (00573cb) +++ lib/groonga/client/response/schema.rb 2016-12-20 16:10:21 +0900 (1230751) @@ -25,6 +25,16 @@ module Groonga class Schema < Base Response.register("schema", self) + # @return [Hash<String, Plugin>] Key is plugin name and + # value is the definition of the plugin. + # + # @since 0.3.6 + def plugins + @plugins ||= HashValueConverter.convert(@body["plugins"]) do |raw_plugin| + Plugin[raw_plugin] + end + end + # @return [Hash<String, Type>] Key is type name and # value is the definition of the type. # @@ -102,6 +112,11 @@ module Groonga end end + class Plugin < ::Hash + include Hashie::Extensions::MergeInitializer + include Hashie::Extensions::MethodAccess + end + class Type < ::Hash include Hashie::Extensions::MergeInitializer include Hashie::Extensions::MethodAccess -------------- next part -------------- HTML����������������������������...Download