Sha256: e16d70587464468bd90ef47d46f0945d5909f58b1fdae02e37eb3a347726ac83

Contents?: true

Size: 244 Bytes

Versions: 6

Compression:

Stored size: 244 Bytes

Contents

class Symbol
  
  # faster Symbol#to_s to speed up routing.
  def to_s
    @str_rep ||= id2name.freeze
  end
  
  # ["foo", "bar"].map &:reverse #=> ['oof', 'rab']
  def to_proc
     Proc.new{|*args| args.shift.__send__(self, *args)}
   end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
merb-0.0.8 lib/merb/core_ext/merb_symbol.rb
merb-0.0.9 lib/merb/core_ext/merb_symbol.rb
merb-0.1.0 lib/merb/core_ext/merb_symbol.rb
merb-0.2.0 lib/merb/core_ext/merb_symbol.rb
merb-0.3.0 lib/merb/core_ext/merb_symbol.rb
merb-0.3.1 lib/merb/core_ext/merb_symbol.rb