class Symbol

Public Instance Methods

keyword() click to toggle source

Returns a symbol with the same name prefixed by a colon. This is convenient when converting a symbol with the {#to_lisp} method.

Example:

“` :foo_bar.keyword.to_lisp => ':foo-bar' “`

# File lib/spectator/emacs.rb, line 40
def keyword
  if self[0] == ':'
    self
  else
    ":#{to_s}".to_sym
  end
end
to_lisp() click to toggle source

Returns a string that represents the symbol as a lisp symbol. Underscores are converted to dashes.

Example:

“` :foo_bar.to_lisp => 'foo-bar' “`

# File lib/spectator/emacs.rb, line 28
def to_lisp
  to_s.gsub "_", "-"
end