def lines
      ret = [Attributes::HEADER]
      # Sort by name, but id goes first
      @attrs.sort_by{|x| x[:name] == 'id' ? '_' : x[:name]}.each do |row|
        line = "# * #{row[:name]} [#{row[:type]}]#{row[:desc].to_s.empty? ? "" : " - #{row[:desc]}"}"
        # split into lines that don't exceed 80 chars
        lt = wrap_text(line, MAX_CHARS_PER_LINE-3).split("\n")
        line = ([lt[0]] + lt[1..-1].map{|x| "#   #{x}"}).join("\n")
        ret << line
      end
      ret
    end
def lines
      ret = [Attributes::HEADER]
      # Sort by name, but id goes first
      @attrs.sort_by{|x| x[:name] == 'id' ? '_' : x[:name]}.each do |row|
        line = "# * #{row[:name]} [#{row[:type]}]#{row[:desc].to_s.empty? ? "" : " - #{row[:desc]}"}"
        # split into lines that don't exceed 80 chars
        lt = wrap_text(line, MAX_CHARS_PER_LINE-3).split("\n")
        line = ([lt[0]] + lt[1..-1].map{|x| "#   #{x}"}).join("\n")
        ret << line
      end
      ret
    end
def lines ret = [ Attributes :: HEADER ] # Sort by name, but id goes first @attrs . sort_by { | x | x [ :name ] == 'id' ? '_' : x [ :name ] } . each do | row | line = "# * #{row[:name]} [#{row[:type]}]#{row[:desc].to_s.empty? ? "" : " - #{row[:desc]}"}" # split into lines that don't exceed 80 chars lt = wrap_text ( line , MAX_CHARS_PER_LINE - 3 ) . split ( "\n" ) line = ( [ lt [ 0 ] ] + lt [ 1 .. - 1 ] . map { | x | "#   #{x}" } ) . join ( "\n" ) ret << line end ret end
Convert attributes array back to attributes lines representation to be put into file
Convert attributes array back to attributes lines representation to be put into file