Module: DataMapper::Serializer::ValidationErrors::ToCsv

### Home Classes Methods

### In Files

- lib/dm-serializer/to_csv.rb

### Methods

- #to_csv

### Files

- LICENSE
- README.rdoc

### Class/Module Index

Quicksearch

- DataMapper
- DataMapper::Collection
- DataMapper::Serializer
- DataMapper::Serializer::Collection
- DataMapper::Serializer::Collection::ToYaml
- DataMapper::Serializer::ValidationErrors
- DataMapper::Serializer::ValidationErrors::ToCsv
- DataMapper::Serializer::ValidationErrors::ToJson
- DataMapper::Serializer::ValidationErrors::ToXml
- DataMapper::Serializer::ValidationErrors::ToYaml
- DataMapper::Serializer::XML
- DataMapper::Serializer::XML::LibXML
- DataMapper::Serializer::XML::Nokogiri
- DataMapper::Serializer::XML::REXML
- DataMapper::Validations
- DataMapper::Validations::ValidationErrors
- Object

No matching classes.

# DataMapper::Serializer::ValidationErrors::ToCsv

### Public Instance Methods

to_csv(*args) click to toggle source

    # File lib/dm-serializer/to_csv.rb, line 34
    def to_csv(*args)
      options = args.first || {}
      options = options.to_h if options.respond_to?(:to_h)
      options[:writer] = '' unless options.has_key? :writer

      CSV.generate(options[:writer]) do |csv|
        errors.each do |key, value|
          value.each do |error|
            row = []
            row << key.to_s
            row << error.to_s
            csv << row
          end
        end
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.