def to_resource_declaration(type)
      if type.respond_to?(:type_name) && type.respond_to?(:title)
        title = type.title
        type_name = type.type_name
      elsif type_result = /(\w+)\['?(\w+)'?\]/.match(type.to_s)
        # not all types have a type_name and title so we
        # output to a string and parse the results
        title = type_result[2]
        type_name = type_result[1]
      else
        return type
      end
      res = scope.catalog.resource(type_name, title)
      return res.to_ral if res
      # don't return anything or returns nil if item is not in the catalog
    end
def to_resource_declaration(type)
      if type.respond_to?(:type_name) && type.respond_to?(:title)
        title = type.title
        type_name = type.type_name
      elsif type_result = /(\w+)\['?(\w+)'?\]/.match(type.to_s)
        # not all types have a type_name and title so we
        # output to a string and parse the results
        title = type_result[2]
        type_name = type_result[1]
      else
        return type
      end
      res = scope.catalog.resource(type_name, title)
      return res.to_ral if res
      # don't return anything or returns nil if item is not in the catalog
    end
looks up the type in the catalog by using the type and title
 and returns the resource in ral format