Class: Hash
Overview
History: Stolen wholesale from ActiveSupport.
Instance Method Summary collapse
Instance Method Details
#to_csv(*args) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/Hash/to_csv.rb', line 21 def to_csv(*args) = args. quote = [:quote] selected_columns = [:selected_columns] collector = [] if selected_columns selected_columns.each{|column| collector << self[column]} else self.each{|k,v| collector << self[v]} end collector.to_csv(quote) end |