lib/messcada/entities/robot_feedback.rb
# Re-work lines to fit a device only capable of 4 lines of text display.
Re-work lines to fit a device only capable of 4 lines of text display.
Re - work lines to fit a device only capable of 4 lines of text display .
def four_lines 
      return [short1, short2, short3, short4] unless [short1, short2, short3, short4].all?(&:nil_or_empty?)
      return [line1, line2, line3, line4] if line5.nil_or_empty? && line6.nil_or_empty?
      ar = [line1, line2, line3, line4, line5, line6].compact
      return ar if ar.length < 5
      if ar.length == 6
        [line1, line2, "#{line3} #{line4}", "#{line5} #{line6}"]
      else
        [ar[0], ar[1], ar[2], "#{ar[3]} #{ar[4]}"]
      end
    end
def four_lines return [ short1 , short2 , short3 , short4 ] unless [ short1 , short2 , short3 , short4 ] . all? ( & :nil_or_empty? ) return [ line1 , line2 , line3 , line4 ] if line5 . nil_or_empty? && line6 . nil_or_empty? ar = [ line1 , line2 , line3 , line4 , line5 , line6 ] . compact return ar if ar . length < 5 if ar . length == 6 [ line1 , line2 , "#{line3} #{line4}" , "#{line5} #{line6}" ] else [ ar [ 0 ] , ar [ 1 ] , ar [ 2 ] , "#{ar[3]} #{ar[4]}" ] end end
Re-work lines to fit a device only capable of 4 lines of text display.
Re - work lines to fit a device only capable of 4 lines of text display .
# rubocop:disable Metrics/AbcSize