Current section

Files

Jump to
fast_ci lib fast_ci structs test counters.ex
Raw

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