mirror of
https://github.com/zhigang1992/rmq.git
synced 2026-01-12 17:52:17 +08:00
ignore punctuation too
This commit is contained in:
@@ -19,13 +19,13 @@ module RubyMotionQuery
|
||||
end
|
||||
|
||||
# Converts any string to a friendly symbol version.
|
||||
# Example: RubyMotionQuery::RMQ.symbolize("This is a TEST!")
|
||||
# Example: RubyMotionQuery::RMQ.symbolize("This is a TEST!!")
|
||||
# #=> :this_is_a_test
|
||||
#
|
||||
# @param [String]
|
||||
# @return [Symbol]
|
||||
def symbolize(s)
|
||||
s.to_s.gsub(/\s+/,"_").downcase.to_sym
|
||||
s.to_s.gsub(/\s+/,"_").gsub(/\W+/,"").downcase.to_sym
|
||||
end
|
||||
|
||||
# @param view
|
||||
|
||||
Reference in New Issue
Block a user