Sha256: 7d3f09ca528e49a55aace2925e4091ca96394d446507aaa1bec432e2a74b7799

Contents?: true

Size: 328 Bytes

Versions: 1

Compression:

Stored size: 328 Bytes

Contents

require "callable/version"

module Callable
  def Callable( callable_or_not )
    if callable_or_not.respond_to?(:call)
      callable_or_not
    else
      proc { |*args| callable_or_not }
    end
  end

  def callable
    Callable(self)
  end

  def callable?
    self.respond_to?(:call)
  end
end

::Object.include(Callable)

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
callable-0.0.3 lib/callable.rb