[groonga-commit:3494] ranguba/hroonga [master] parse_*** should be private methods
null+ranguba at clear-code.com
null+ranguba at clear-code.com
Fri Jun 17 21:51:38 EDT 2011
SHIMODA Hiroshi 2011-06-18 01:51:38 +0000 (Sat, 18 Jun 2011)
New Revision: 715284a255abee562cb32e9ebe5e509e2f351264
Merged e63ed30: Merge branch 'master' of https://github.com/ranguba/hroonga into select-command
Log:
parse_*** should be private methods
Modified files:
lib/hroonga/command/request.rb
Modified: lib/hroonga/command/request.rb (+29 -29)
===================================================================
--- lib/hroonga/command/request.rb 2011-06-18 01:50:20 +0000 (35055f6)
+++ lib/hroonga/command/request.rb 2011-06-18 01:51:38 +0000 (b7f086d)
@@ -37,48 +37,19 @@ module Hroonga
@command_path ||= parse_command_path
end
- def parse_command_path
- command_path = path
- command_path[Dispatcher.path_prefix] = ""
- command_path
- end
-
def table_name
@table_name ||= parse_table_name
end
- def parse_table_name
- name = command_path.split("/")[1]
- unescape(name)
- end
-
def column_name
@column_name ||= parse_column_name
end
- def parse_column_name
- name_match = command_path.match(/\/columns\/([^\/+])/)
- if name_match
- unescape(name_match.to_a[1])
- else
- nil
- end
- end
-
def record_key
@record_key ||= parse_record_key
end
- def parse_record_key
- key_match = command_path.match(/\/records\/([^\/+])/)
- if key_match
- unescape(key_match.to_a[1])
- else
- nil
- end
- end
-
def table_type
@table_type ||= snake_cased_option("table_type") || DEFAULT_TABLE_TYPE
@@ -98,6 +69,35 @@ module Hroonga
private
+ def parse_command_path
+ command_path = path
+ command_path[Dispatcher.path_prefix] = ""
+ command_path
+ end
+
+ def parse_table_name
+ name = command_path.split("/")[1]
+ unescape(name)
+ end
+
+ def parse_column_name
+ name_match = command_path.match(/\/columns\/([^\/+])/)
+ if name_match
+ unescape(name_match.to_a[1])
+ else
+ nil
+ end
+ end
+
+ def parse_record_key
+ key_match = command_path.match(/\/records\/([^\/+])/)
+ if key_match
+ unescape(key_match.to_a[1])
+ else
+ nil
+ end
+ end
+
def unescape(string)
Rack::Utils.unescape(string)
end
More information about the groonga-commit
mailing list