NullStream.<<()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
1
# frozen_string_literal: true
2
3
module AMA
4
  module Entity
5
    class Mapper
6
      module Aux
7
        # :nocov:
8
        # I just did copy-paste from SO
9
        # https://stackoverflow.com/a/8681953/2908793
10
        #
11
        # This class is required to use logger without any real output backend,
12
        # which is by default
13
        class NullStream
14
          INSTANCE = new
15
16
          def write(message, *)
17
            message.size
18
          end
19
20
          def close(*); end
21
22
          def <<(*)
23
            self
24
          end
25
        end
26
        # :nocov:
27
      end
28
    end
29
  end
30
end
31