github
0 of 18 new or added lines in 4 files covered. (0.0%)
3922 existing lines in 105 files now uncovered.0 of 4086 relevant lines covered (0.0%)
0.0 hits per line
1 |
# frozen_string_literal: true
|
|
2 |
|
|
3 |
# A value object representing an audio format, consisting of codec, bitrate and channels.
|
|
UNCOV
4
|
class AudioFormat |
× |
5 |
|
|
UNCOV
6
|
attr_reader :codec, :bitrate, :channels |
× |
7 |
|
|
UNCOV
8
|
delegate :file_extension, :mime_type, to: :encoding |
× |
9 |
|
|
UNCOV
10
|
def initialize(codec, bitrate, channels) |
× |
UNCOV
11
|
@codec = codec
|
× |
UNCOV
12
|
@bitrate = bitrate
|
× |
UNCOV
13
|
@channels = channels
|
× |
UNCOV
14
|
end
|
× |
15 |
|
|
UNCOV
16
|
def encoding |
× |
UNCOV
17
|
AudioEncoding.fetch(codec)
|
× |
UNCOV
18
|
end
|
× |
19 |
|
|
UNCOV
20
|
def ==(other) |
× |
UNCOV
21
|
codec == other.codec && |
× |
UNCOV
22
|
bitrate == other.bitrate && |
× |
UNCOV
23
|
channels == other.channels |
× |
UNCOV
24
|
end
|
× |
UNCOV
25
|
alias eql? == |
× |
26 |
|
|
UNCOV
27
|
def hash |
× |
UNCOV
28
|
[codec, bitrate, channels].hash |
× |
UNCOV
29
|
end
|
× |
30 |
|
|
UNCOV
31
|
end
|
× |