Sha256: f4e5fa427a09e2da82185ee587d7b6ef29056f695c5fc380cb9a7e928bd4adc2

Contents?: true

Size: 317 Bytes

Versions: 2

Compression:

Stored size: 317 Bytes

Contents

class Symbol
  include LambdaDriver::Callable
  include LambdaDriver::Currying if RUBY_VERSION < '1.9.0'

  def to_method
    lambda{|obj| obj._(self) }
  end
  alias_method :-@, :to_method

  def to_method_with_args(*args)
    lambda{|obj| obj._(self).call(*args) }
  end
  alias_method :&, :to_method_with_args
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lambda_driver-1.2.0 lib/lambda_driver/core_ext/symbol.rb
lambda_driver-1.1.2 lib/lambda_driver/core_ext/symbol.rb