[Groonga-commit] groonga/groonga-command at a673a7d [master] Add Command#command_name

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Mar 21 12:44:40 JST 2016


Kouhei Sutou	2016-03-21 12:44:40 +0900 (Mon, 21 Mar 2016)

  New Revision: a673a7d91e95a974a5b7f5f873a7a61ef72e5753
  https://github.com/groonga/groonga-command/commit/a673a7d91e95a974a5b7f5f873a7a61ef72e5753

  Message:
    Add Command#command_name
    
    Make Command#name deprecated.
    
    Because #name is also used as "name" argument reader.

  Modified files:
    lib/groonga/command/base.rb

  Modified: lib/groonga/command/base.rb (+15 -3)
===================================================================
--- lib/groonga/command/base.rb    2016-03-21 12:28:52 +0900 (ee6cb93)
+++ lib/groonga/command/base.rb    2016-03-21 12:44:40 +0900 (0663b9f)
@@ -51,16 +51,28 @@ module Groonga
         end
       end
 
-      attr_reader :name, :arguments
+      attr_reader :command_name, :arguments
       attr_accessor :original_format, :original_source, :path_prefix
-      def initialize(name, pair_arguments, ordered_arguments=[])
-        @name = name
+      def initialize(command_name, pair_arguments, ordered_arguments=[])
+        @command_name = command_name
         @arguments = construct_arguments(pair_arguments, ordered_arguments)
         @original_format = nil
         @original_source = nil
         @path_prefix = "/d/"
       end
 
+      # @deprecated since 1.1.8. Use {#command_name} instead.
+      def name
+        command_name
+      end
+
+      # @return [String] The command name.
+      #
+      # @since 1.1.8
+      def command_name
+        @command_name
+      end
+
       def [](name)
         @arguments[normalize_name(name)]
       end
-------------- next part --------------
HTML����������������������������...
Download 



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