Sha256: ee46058c50b255e5445d972dd08b19d7d50862cbdaafff219a6de3ddc2140dd2

Contents?: true

Size: 585 Bytes

Versions: 15

Compression:

Stored size: 585 Bytes

Contents

require 'ludy/proc/curry'

module Ludy

  module Curry
    def self.included target
      target.module_eval{
        instance_methods.each{ |m|
          next unless m =~ /^\w/
          module_eval <<-END
            def c#{m} *args, &block
              if args.size == method(:#{m}).arity
                self.__send__ :#{m}, *args, &block
              else
                method(:c#{m}).to_proc.send :__curry__, *args
              end
            end
          END
        }
      }
    end
  end

end

=begin
              method(:#{m}).to_proc.curry.call *args, &block
=end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
godfat-ludy-0.1.13 lib/ludy/deprecated/curry.rb
ludy-0.1.15 lib/ludy/deprecated/curry.rb
ludy-0.1.0 lib/ludy/deprecated/curry.rb
ludy-0.1.1 lib/ludy/deprecated/curry.rb
ludy-0.1.11 lib/ludy/deprecated/curry.rb
ludy-0.1.13 lib/ludy/deprecated/curry.rb
ludy-0.1.10 lib/ludy/deprecated/curry.rb
ludy-0.1.2 lib/ludy/deprecated/curry.rb
ludy-0.1.6 lib/ludy/deprecated/curry.rb
ludy-0.1.4 lib/ludy/deprecated/curry.rb
ludy-0.1.3 lib/ludy/deprecated/curry.rb
ludy-0.1.5 lib/ludy/deprecated/curry.rb
ludy-0.1.7 lib/ludy/deprecated/curry.rb
ludy-0.1.8 lib/ludy/deprecated/curry.rb
ludy-0.1.9 lib/ludy/deprecated/curry.rb