class Versionomy::Format::Delimiter::MappingSymbolBuilder

Methods in this class can be called from the block passed to Versionomy::Format::Delimiter::SymbolFieldBuilder#recognize_regexp_map to define the mapping between the values of a symbolic field and the string representations of those values.

Public Instance Methods

map(value_, representation_, regexp_=nil) click to toggle source

Map a value to a string representation. The optional regexp field, if specified, provides a regular expression pattern for matching the value representation. If it is omitted, the representation is used as the regexp.

# File lib/versionomy/format/delimiter.rb, line 645
def map(value_, representation_, regexp_=nil)
  regexp_ ||= representation_
  array_ = [regexp_, representation_, value_]
  @mappings_by_value[value_] ||= array_
  @mappings_in_order << array_
end