In Files

  • mrbgems/mruby-symbol-ext/mrblib/symbol.rb

Symbol

Public Instance Methods

capitalize → symbol click to toggle source

Same as sym.to_s.capitalize.intern.

 
               # File mrbgems/mruby-symbol-ext/mrblib/symbol.rb, line 18
def capitalize
  (self.to_s.capitalize! || self).to_sym
end
            
casecmp(other) → -1, 0, +1 or nil click to toggle source

Case-insensitive version of Symbol#<=>.

 
               # File mrbgems/mruby-symbol-ext/mrblib/symbol.rb, line 48
def casecmp(other)
  return nil unless other.kind_of?(Symbol)
  lhs =  self.to_s; lhs.upcase!
  rhs = other.to_s; rhs.upcase!
  lhs <=> rhs
end
            
downcase → symbol click to toggle source

Same as sym.to_s.downcase.intern.

 
               # File mrbgems/mruby-symbol-ext/mrblib/symbol.rb, line 28
def downcase
  (self.to_s.downcase! || self).to_sym
end
            
empty? → true or false click to toggle source

Returns that sym is :“” or not.

 
               # File mrbgems/mruby-symbol-ext/mrblib/symbol.rb, line 61
def empty?
  self.length == 0
end
            
to_proc() click to toggle source
 
               # File mrbgems/mruby-symbol-ext/mrblib/symbol.rb, line 6
def to_proc
  ->(obj,*args,&block) do
    obj.__send__(self, *args, &block)
  end
end
            
upcase → symbol click to toggle source

Same as sym.to_s.upcase.intern.

 
               # File mrbgems/mruby-symbol-ext/mrblib/symbol.rb, line 38
def upcase
  (self.to_s.upcase! || self).to_sym
end