lib/shipping_materials/csv_dsl.rb
# This method is on the complex side. It is a DSL method that
# performs type-checking and also sets the headers.
# Be sure to see headers=() defined below
This method is on the complex side. It is a DSL method that
performs type-checking and also sets the headers.
Be sure to see headers=() defined below
This method is on the complex side . It is a DSL method that performs type - checking and also sets the headers . Be sure to see headers = () defined below
def row(collection, callbacks={})
      if collection.is_a? Array
        update_row_maps(:object, collection, callbacks)
      elsif collection.is_a? Hash
        f = collection.first
        if f[1].is_a? Array
          update_row_maps(f[0], f[1], callbacks)
        elsif f[1].is_a? Hash
          self.headers = f[1]
          update_row_maps(f[0], f[1].values, callbacks)
        else
          self.headers = collection
          update_row_maps(:object, collection.values, callbacks)
        end
      end
    end
def row ( collection , callbacks = { } ) if collection . is_a? Array update_row_maps ( :object , collection , callbacks ) elsif collection . is_a? Hash f = collection . first if f [ 1 ] . is_a? Array update_row_maps ( f [ 0 ] , f [ 1 ] , callbacks ) elsif f [ 1 ] . is_a? Hash self . headers = f [ 1 ] update_row_maps ( f [ 0 ] , f [ 1 ] . values , callbacks ) else self . headers = collection update_row_maps ( :object , collection . values , callbacks ) end end end
This method is on the complex side.
This method is on the complex side .
collection
<not_specific>
callbacks
<not_specific>