module TurkishSupport
The TurkishSupport
module responsible for making some String and Array methods compatible with Turkish language by using Ruby language's refinements feature.
You can check refinements at docs.ruby-lang.org/en/master/doc/syntax/refinements_rdoc.html
Refined Methods¶ ↑
-
String#<=>
-
String#[]
-
String#[]=
-
String#capitalize
-
String#casecmp
-
String#downcase
-
String#gsub
-
String#index
-
String#match
-
String#partition
-
String#rpartition
-
String#rindex
-
String#scan
-
String#slice
-
String#split
-
String#sub
-
String#swapcase
-
String#titleize
-
String#upcase
Constants
- CASE_METHODS
- REGEX_METHODS
- VERSION
Public Instance Methods
titleize()
click to toggle source
capitalize all words and returns a copy of the string
@return [String]
# File lib/turkish_support/string_methods.rb, line 20 def titleize downcase.gsub(/\b\S/u).each { _1.upcase } end
titleize!()
click to toggle source
capitalize all words in place @return [String]
# File lib/turkish_support/string_methods.rb, line 26 def titleize! replace(titleize) end