github
42 of 42 new or added lines in 8 files covered. (100.0%)
29 existing lines in 11 files now uncovered.51710 of 52207 relevant lines covered (99.05%)
754.76 hits per line
| 1 |
# frozen_string_literal: true
|
|
| 2 |
|
|
| 3 |
class API2 |
4✔ |
| 4 |
# API exception base class.
|
|
| 5 |
class Error < ::StandardError |
4✔ |
| 6 |
attr_accessor :tag, :args, :fatal, :trace |
4✔ |
| 7 |
|
|
| 8 |
def initialize |
4✔ |
| 9 |
super
|
403✔ |
| 10 |
self.tag = self.class.name.underscore.tr("/", "_"). |
403✔ |
| 11 |
sub(/^api\d+/, "api").to_sym |
|
| 12 |
self.args = {}
|
403✔ |
| 13 |
self.fatal = false |
403✔ |
| 14 |
self.trace = caller
|
403✔ |
| 15 |
end
|
|
| 16 |
|
|
| 17 |
def inspect |
4✔ |
|
UNCOV
18
|
"#{self.class.name}(:#{tag}#{args.inspect})"
|
× |
| 19 |
end
|
|
| 20 |
|
|
| 21 |
def to_s |
4✔ |
| 22 |
tag.l(args) |
114✔ |
| 23 |
end
|
|
| 24 |
|
|
| 25 |
def t |
4✔ |
|
UNCOV
26
|
tag.t(args) |
× |
| 27 |
end
|
|
| 28 |
end
|
|
| 29 |
end
|