[Groonga-commit] droonga/droonga-engine at b020393 [master] Define shorthand to store/get role of myself

Back to archive index

YUKI Hiroshi null+****@clear*****
Tue Apr 21 12:01:15 JST 2015


YUKI Hiroshi	2015-04-21 12:01:15 +0900 (Tue, 21 Apr 2015)

  New Revision: b020393be4a29b8e0e11b940c94503f8b9dc6025
  https://github.com/droonga/droonga-engine/commit/b020393be4a29b8e0e11b940c94503f8b9dc6025

  Message:
    Define shorthand to store/get role of myself

  Modified files:
    lib/droonga/node_role.rb

  Modified: lib/droonga/node_role.rb (+13 -0)
===================================================================
--- lib/droonga/node_role.rb    2015-04-21 12:00:50 +0900 (e405d4c)
+++ lib/droonga/node_role.rb    2015-04-21 12:01:15 +0900 (b9c0605)
@@ -29,6 +29,19 @@ module Droonga
       def valid?(role)
         ROLES.include?(role)
       end
+
+      def my_role
+        if @my_role
+          @my_role.to_s
+        else
+          SERVICE_PROVIDER
+        end
+      end
+
+      def my_role=(new_role)
+        @my_role = new(new_role)
+        @my_role.to_s
+      end
     end
 
     def initialize(role)
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index