Same as sym.to_s.capitalize.intern
.
# File mrbgems/mruby-symbol-ext/mrblib/symbol.rb, line 12 def capitalize (self.to_s.capitalize! || self).to_sym end
Case-insensitive version of Symbol#<=>
.
# File mrbgems/mruby-symbol-ext/mrblib/symbol.rb, line 42 def casecmp(other) return nil unless other.kind_of?(Symbol) lhs = self.to_s; lhs.upcase! rhs = other.to_s.upcase lhs <=> rhs end
Returns true if sym and other_sym are equal after case folding, false if they are not equal, and nil if other_sym is not a string.
# File mrbgems/mruby-symbol-ext/mrblib/symbol.rb, line 56 def casecmp?(sym) c = self.casecmp(sym) return nil if c.nil? return c == 0 end
Same as sym.to_s.downcase.intern
.
# File mrbgems/mruby-symbol-ext/mrblib/symbol.rb, line 22 def downcase (self.to_s.downcase! || self).to_sym end
Returns that sym is :“” or not.
# File mrbgems/mruby-symbol-ext/mrblib/symbol.rb, line 68 def empty? self.length == 0 end