class Symbol

Monkey-patch Ruby symbols to act more like Clojure keywords

Public Instance Methods

call(target) click to toggle source
# File lib/rubylisp/types.rb, line 22
def call(target)
  if [Hash, Hamster::Hash].member? target.class
    target[self]
  else
    target.instance_variable_get "@#{name}".to_sym
  end
end
name() click to toggle source
# File lib/rubylisp/types.rb, line 13
    def name
            without_colon = inspect[1..-1]
if without_colon[0] == '"' && without_colon[-1] == '"'
  without_colon[1..-2]
else
  without_colon
end
    end