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
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus