Module: FatCore::Symbol
- Included in:
- Symbol
- Defined in:
- lib/fat_core/symbol.rb
Instance Method Summary collapse
-
#as_string ⇒ String
(also: #entitle)
Convert to a title-ized string, that is, convert all '_' to a space, then call String#entitle on the result.
-
#as_sym ⇒ Symbol
Return self.
-
#tex_quote ⇒ String
Prepare this symbol for use in a TeX document by converting to String then quoting it.
Instance Method Details
#as_string ⇒ String Also known as: entitle
Convert to a title-ized string, that is, convert all '_' to a space, then call String#entitle on the result.
14 15 16 |
# File 'lib/fat_core/symbol.rb', line 14 def as_string to_s.tr('_', ' ').split(' ').join(' ').entitle end |
#as_sym ⇒ Symbol
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.
24 25 26 |
# File 'lib/fat_core/symbol.rb', line 24 def as_sym self end |
#tex_quote ⇒ String
Prepare this symbol for use in a TeX document by converting to String then quoting it.
35 36 37 |
# File 'lib/fat_core/symbol.rb', line 35 def tex_quote to_s.tex_quote end |