Current section
Files
Jump to
Current section
Files
lib/fast_ci/structs/test/counters.ex
defmodule FastCi.Structs.Test.Counters do
defstruct failed: 0,
passed: 0,
pending: 0
@type t :: %__MODULE__{
failed: integer(),
passed: integer(),
pending: integer()
}
defimpl Jason.Encoder, for: FastCi.Structs.Test.Counters do
def encode(%FastCi.Structs.Test.Counters{} = data, opts) do
%{
failed: data.failed,
passed: data.passed,
pending: data.pending
}
|> Jason.Encode.map(opts)
end
end
end