convert

convert( name )
convert { |field| ... }
convert { |field, field_info| ... }
Instance Public methods

You can use this method to install a CSV::Converters built-in, or provide a block that handles a custom conversion.

If you provide a block that takes one argument, it will be passed the field and is expected to return the converted value or the field itself. If your block takes two arguments, it will also be passed a CSV::FieldInfo Struct, containing details about the field. Again, the block should return a converted field or the field itself.

doc_ruby_on_rails
2015-04-01 22:31:53
Comments
Leave a Comment

Please login to continue.