Sha256: 4c8bc4ce2784a92241d8694e8cf9d64da1154df0f5c77235e35e2078f3d255be

Contents?: true

Size: 259 Bytes

Versions: 16

Compression:

Stored size: 259 Bytes

Contents

module Kernel

  # Like #respond_to? but returns the result of the call if
  # it does respond.
  #
  # (This is used to be called #respond_with_value.)

  def respond(sym, *args)
    return nil if not respond_to?(sym, *args)
    send(sym, *args)
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
facets-1.4.2 lib/facets/core/kernel/respond.rb
facets-1.4.0 lib/facets/core/kernel/respond.rb
facets-1.4.1 lib/facets/core/kernel/respond.rb
facets-1.4.3 lib/facets/core/kernel/respond.rb
facets-1.4.4 lib/facets/core/kernel/respond.rb
facets-1.4.5 lib/facets/core/kernel/respond.rb
facets-1.7.0 lib/facets/core/kernel/respond.rb
facets-1.7.30 lib/facets/core/kernel/respond.rb
facets-1.7.38 lib/facets/core/kernel/respond.rb
facets-1.7.46 lib/facets/core/kernel/respond.rb
facets-1.8.0 lib/facets/core/kernel/respond.rb
facets-1.8.20 lib/facets/core/kernel/respond.rb
facets-1.8.49 lib/facets/core/kernel/respond.rb
facets-1.8.51 lib/facets/core/kernel/respond.rb
facets-1.8.54 lib/facets/core/kernel/respond.rb
facets-1.8.8 lib/facets/core/kernel/respond.rb