lib/gtfs_api/io/models/concerns/gtfsable.rb
#
# returns a hash with the cols of the row of the corresponding file.
# It assigns to each key (column of the file) the value of the mapped
#  attribute.
#
# To see how to map each column to an attribute @see set_gtfs_col
#
# It calls the hook after_to_gtfs_feed (gtfs_feed_row) which allows the
# model to override the default assignation if necessary
#
# returns empty hash if there is no mapping
returns a hash with the cols of the row of the corresponding file.
It assigns to each key (column of the file) the value of the mapped
attribute.

To see how to map each column to an attribute @see set_gtfs_col

It calls the hook after_to_gtfs_feed (gtfs_feed_row) which allows the
model to override the default assignation if necessary

returns empty hash if there is no mapping
returns a hash with the cols of the row of the corresponding file . It assigns to each key ( column of the file ) the value of the mapped attribute . To see how to map each column to an attribute @see set_gtfs_col It calls the hook after_to_gtfs_feed ( gtfs_feed_row ) which allows the model to override the default assignation if necessary returns empty hash if there is no mapping
def to_gtfs
            gtfs_feed_row = {}
            return gtfs_feed_row if self.class.gtfs_cols.nil?
            self.class.gtfs_cols.each do |model_attr,feed_col|
              col_value = self.send(model_attr)
              col_value = col_value.to_gtfs if (col_value.is_a?(Date) || col_value.is_a?(Time))
              gtfs_feed_row[feed_col] = col_value
            end
            self.after_to_gtfs(gtfs_feed_row)
          end
def to_gtfs gtfs_feed_row = { } return gtfs_feed_row if self . class . gtfs_cols . nil? self . class . gtfs_cols . each do | model_attr , feed_col | col_value = self . send ( model_attr ) col_value = col_value . to_gtfs if ( col_value . is_a? ( Date ) || col_value . is_a? ( Time ) ) gtfs_feed_row [ feed_col ] = col_value end self . after_to_gtfs ( gtfs_feed_row ) end
returns a hash with the cols of the row of the corresponding file.
returns a hash with the cols of the row of the corresponding file .
#rehash to gtfs feed #call send because virt. attr can only be accessed like that