Module: Hashie::Utils

Defined in:
lib/hashie/utils.rb

Overview

A collection of helper methods that can be used throughout the gem.

Class Method Summary collapse

Class Method Details

.method_information(bound_method) ⇒ String

Describes a method by where it was defined.

Parameters:

  • bound_method (Method)

    The method to describe.

Returns:

  • (String)


8
9
10
11
12
13
14
# File 'lib/hashie/utils.rb', line 8

def self.method_information(bound_method)
  if bound_method.source_location
    "defined at #{bound_method.source_location.join(':')}"
  else
    "defined in #{bound_method.owner}"
  end
end