travis-ci
6272 of 6272 new or added lines in 158 files covered. (100.0%)
17279 of 17578 relevant lines covered (98.3%)
104.27 hits per line
1 |
|
|
2 |
# encoding: utf-8
|
|
|
|
5✔ |
|
module Adhearsion |
5✔ |
|
module Translator |
5✔ |
|
class Asterisk |
5✔ |
|
class Channel < SimpleDelegator |
5✔ |
8 |
NORMALIZATION_REGEXP = /^(?<prefix>Bridge\/)*(?<name>[^<>]*)(?<suffix><.*>)*$/.freeze |
|
|
|
5✔ |
|
def self.new(other) |
346✔ |
11 |
other.is_a?(self) ? other : super |
|
12 |
end
|
|
|
|
5✔ |
|
def name |
266✔ |
15 |
matchdata[:name]
|
|
16 |
end
|
|
|
|
5✔ |
|
def prefix |
45✔ |
19 |
matchdata[:prefix]
|
|
20 |
end
|
|
|
|
5✔ |
|
def suffix |
35✔ |
23 |
matchdata[:suffix]
|
|
24 |
end
|
|
|
|
5✔ |
|
def bridged? |
54✔ |
27 |
@bridged ||= (prefix || suffix)
|
|
28 |
end
|
|
|
|
5✔ |
|
def to_s |
× |
31 |
__getobj__ |
|
32 |
end
|
|
|
|
5✔ |
34 |
private |
|
|
|
5✔ |
|
def matchdata |
330✔ |
37 |
@matchdata ||= __getobj__.match(NORMALIZATION_REGEXP) |
|
38 |
end
|
|
39 |
end
|
|
40 |
end
|
|
41 |
end
|
|
42 |
end
|