class XSemVer::SemVer

def save file=nil

def save file=nil
  file ||= @file
  hash = {
    :major => @major,
    :minor => @minor,
    :patch => @patch,
    :special => @special,
    :metadata => @metadata
  }
  yaml = YAML.dump hash
  open(file, 'w') { |io| io.write yaml }
end