lib/allocation_stats/allocation.rb
# Returns class name, plus, for Arrays, extended information. When all of
# the elements of the Array are instances of a total of three or fewer
# classes, then those classes are listed in brackets. For example:
#
# @example Array with only Fixnum and Bignum elements
#   allocation.class_plus  #=> "Array<Fixnum,Bignum>"
# @example Array with elements of class A, B, C, and D
#   allocation.class_plus  #=> "Array"
# @example String (not an Array)
#   allocation.class_plus  #=> "String"
Returns class name, plus, for Arrays, extended information. When all of
the elements of the Array are instances of a total of three or fewer
classes, then those classes are listed in brackets. For example.
Returns class name plus for Arrays extended information . When all of the elements of the Array are instances of a total of three or fewer classes then those classes are listed in brackets . For example .
def class_plus
      case @object
      when Array
        object_classes = element_classes(@object.map {|e| e.class }.uniq)
        if object_classes
          "Array<#{object_classes}>"
        else
          "Array"
        end
      else
        @object.class.name
      end
    end
def class_plus case @object when Array object_classes = element_classes ( @object . map { | e | e . class } . uniq ) if object_classes "Array<#{object_classes}>" else "Array" end else @object . class . name end end
Returns class name, plus, for Arrays, extended information.
Returns class name plus for Arrays extended information .
example
Array with only Fixnum and Bignum elements allocation.class_plus #=> "Array"
Array with only Fixnum and Bignum elements allocation . class_plus # = > " Array "
example
Array with elements of class A, B, C, and D allocation.class_plus #=> "Array"
Array with elements of class A B C and D allocation . class_plus # = > " Array "
example
String (not an Array) allocation.class_plus #=> "String"
String ( not an Array ) allocation . class_plus # = > " String "