Sha256: 9723360376f3017bc5f5c3eb6b9780070ee957fd2ad47d2a327dc81d4ad9c60e

Contents?: true

Size: 268 Bytes

Versions: 10

Compression:

Stored size: 268 Bytes

Contents

module Kernel

  # Like #respond_to? but returns the result of the call
  # if it does indeed 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

10 entries across 10 versions & 1 rubygems

Version Path
facets-2.0.0 lib/core/facets/kernel/respond.rb
facets-2.0.1 lib/core/facets/kernel/respond.rb
facets-2.0.2 lib/core/facets/kernel/respond.rb
facets-2.1.0 lib/core/facets/kernel/respond.rb
facets-2.1.1 lib/core/facets/kernel/respond.rb
facets-2.1.2 lib/core/facets/kernel/respond.rb
facets-2.0.3 lib/core/facets/kernel/respond.rb
facets-2.0.4 lib/core/facets/kernel/respond.rb
facets-2.0.5 lib/core/facets/kernel/respond.rb
facets-2.1.3 lib/core/facets/kernel/respond.rb