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