module FatCore::Symbol

Public Instance Methods

as_string() click to toggle source

Convert to a title-ized string, that is, convert all '_' to a space, then call String#entitle on the result.

@example

:hello_world.entitle #=> "Hello World"
:hello_world.as_string #=> "Hello World"
:joy_to_the_world #=> 'Joy to the World'

@return [String]

# File lib/fat_core/symbol.rb, line 16
def as_string
  to_s.tr('_', ' ').split(' ').join(' ').entitle
end
Also aliased as: entitle
as_sym() click to toggle source

Return self. This (together with String#as_sym) allows `#as_sym` to be applied to a string or Symbol and get back a Symbol with out testing for type.

@return [Symbol] just self

# File lib/fat_core/symbol.rb, line 26
def as_sym
  self
end
entitle()
Alias for: as_string
tex_quote() click to toggle source

Prepare this symbol for use in a TeX document by converting to String then quoting it.

@example

:hammer_smith.tex_quote  #=> "hammer\\_smith"

@return [String]

# File lib/fat_core/symbol.rb, line 37
def tex_quote
  to_s.tex_quote
end