lib/blinkbox/common_mapping.rb
# Stores a retrieved mapping file along with the timestamp
#
# @param [Time] timestamp The timestamp at which the given mapping was accurate
# @param [Hash, CommonMessaging::MappingUpdateV1] mapping The mapping file which needs to be stored
# @return [Boolean] Returns true if the mapping file was updated, false if the mapping already stored was the same or more recent.
Stores a retrieved mapping file along with the timestamp
Stores a retrieved mapping file along with the timestamp
def update_mapping!(timestamp, mapping)
      return false if (!@mapping.nil? && timestamp < @mapping[:timestamp])
      return false if (!@mapping.nil? && @mapping[:data] == mapping)
      @mapping = {
        data: mapping,
        timestamp: timestamp
      }
      true
    end
def update_mapping! ( timestamp , mapping ) return false if ( ! @mapping . nil? && timestamp < @mapping [ :timestamp ] ) return false if ( ! @mapping . nil? && @mapping [ :data ] == mapping ) @mapping = { data : mapping , timestamp : timestamp } true end
Stores a retrieved mapping file along with the timestamp
Stores a retrieved mapping file along with the timestamp
Returns true if the mapping file was updated, false if the mapping already stored was the same or more recent.
Returns true if the mapping file was updated false if the mapping already stored was the same or more recent .
Boolean
timestamp
mapping
mapping The mapping file which needs to be stored
mapping The mapping file which needs to be stored