Sha256: 8af94585bb062339ab76590f791d9453bf8e0a017ef349d4a4cd881f5d2ec430

Contents?: true

Size: 573 Bytes

Versions: 2

Compression:

Stored size: 573 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) # rubocop:disable Naming/MethodName
      case value
      when ObjectInspector::Scope
        value
      else
        ObjectInspector::Scope.new(value)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
object_inspector-0.5.1 lib/object_inspector/conversions.rb
object_inspector-0.5.0 lib/object_inspector/conversions.rb