Completed
Push — dev ( ff1c91...ab1075 )
by Fike
01:06
created

NullStream   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
dl 0
loc 13
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A write() 0 3 1
A close() 0 1 1
A <<() 0 3 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