Sha256: f09d107355fd0e072272540a25e2442a2ce7c6f1ea4d5d1a7b8610d89370e1a2

Contents?: true

Size: 536 Bytes

Versions: 3

Compression:

Stored size: 536 Bytes

Contents

module ObjectInspector
  # ObjectInspector::Conversions defines conversion functions used by
  # ObjectInspector.
  module Conversions

  module_function

    # Convert the passed in value to an {ObjectInspector::Scope} object.
    # Just returns the pass in value if it already is an
    # {ObjectInspector::Scope} object.
    #
    # @return [ObjectInspector::Scope]
    def Scope(value)
      case value
      when ObjectInspector::Scope
        value
      else
        ObjectInspector::Scope.new(value)
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
object_inspector-0.4.0 lib/object_inspector/conversions.rb
object_inspector-0.3.1 lib/object_inspector/conversions.rb
object_inspector-0.3.0 lib/object_inspector/conversions.rb