push
github
195 of 205 new or added lines in 18 files covered. (95.12%)
5009 of 5214 relevant lines covered (96.07%)
130266.13 hits per line
1 |
# frozen_string_literal: true
|
|
2 |
|
|
|
module Ably::Util |
40✔ |
|
module AblyExtensions |
40✔ |
|
refine Object do |
40✔ |
|
def nil_or_empty? |
40✔ |
|
self.nil? || self.empty? |
61,119✔ |
8 |
end
|
|
9 |
end
|
|
10 |
|
|
|
refine Hash do |
40✔ |
|
def fetch_with_default(key, default) |
40✔ |
|
value = self.fetch(key, default)
|
49,412✔ |
|
if value.nil?
|
49,412✔ |
NEW
|
return default
|
× |
16 |
end
|
|
|
return value
|
49,412✔ |
18 |
end
|
|
19 |
|
|
|
def delete_with_default(key, default) |
40✔ |
|
value = self.delete(key)
|
43,256✔ |
|
if value.nil?
|
43,256✔ |
|
return default
|
42,276✔ |
24 |
end
|
|
|
return value
|
980✔ |
26 |
end
|
|
27 |
end
|
|
28 |
end
|
|
29 |
end
|