def cast_with_puppet_resource(object, type)
      cast = cast_without_puppet_resource(object, type)
      # check the object to see if it has an acestor (< ) of the specified type
      if defined?(::Puppet::Type) && (object.class < ::Puppet::Type)
        cast = :puppet_type
      elsif defined?(::Puppet::Pops::Types) && (object.class < ::Puppet::Pops::Types)
        cast = :puppet_type
      elsif defined?(::Puppet::Parser::Resource) && (object.class < ::Puppet::Parser::Resource)
        cast = :puppet_resource
      elsif /Puppet::Pops::Types/.match(object.class.to_s)
        cast = :puppet_type
      end
      cast
    end
def cast_with_puppet_resource(object, type)
      cast = cast_without_puppet_resource(object, type)
      # check the object to see if it has an acestor (< ) of the specified type
      if defined?(::Puppet::Type) && (object.class < ::Puppet::Type)
        cast = :puppet_type
      elsif defined?(::Puppet::Pops::Types) && (object.class < ::Puppet::Pops::Types)
        cast = :puppet_type
      elsif defined?(::Puppet::Parser::Resource) && (object.class < ::Puppet::Parser::Resource)
        cast = :puppet_resource
      elsif /Puppet::Pops::Types/.match(object.class.to_s)
        cast = :puppet_type
      end
      cast
    end
this tells ap how to cast our object so we can be specific
 about printing different puppet objects