# File lib/openshift-origin-common/models/model.rb, line 105
    def attributes(should_convert_nested_models=false)
      @attributes = {}

      klass = self.class
      var_names = self.instance_variable_names.map{|n| n[1..-1]}
      while(klass != OpenShift::Model)
        var_names += klass.includes_attributes.map{|n| n.to_s}
        var_names -= ['attributes', 'changed_attributes', 'previously_changed', 'persisted', 'new_record', 'deleted', 'errors', 'validation_context']
        var_names -= klass.excludes_attributes.map{|n| n.to_s}
        klass = klass.superclass
      end

      var_names.each do |name|
        #next if ['attributes', 'changed_attributes', 'previously_changed', 'persisted', 'new_record', 'deleted', 'errors', 'validation_context'].include? name
        #next if self.class.excludes_attributes.include? name.to_sym
        value = self.send(name.to_s)
        if should_convert_nested_models
          @attributes[name] = convert_nested_models(value)
        else
          @attributes[name] = value
        end
      end
      @attributes
    end