Skip to content
Browse files

Colorize a record

  • Loading branch information...
1 parent 4d5c617 commit 0b4785129e2092917fd5888a5156452200e8834a @BjRo committed Jan 21, 2014
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/apex/format/tuple.ex
View
7 lib/apex/format/tuple.ex
@@ -7,12 +7,15 @@ defimpl Apex.Format, for: Tuple do
end
defp do_format({key, value}, options) when is_atom(key) do
- "#{key}: " <> Apex.Format.format(value, options)
+ colorize("#{key}: ", key, options) <> Apex.Format.format(value, options)
end
defp do_format(data, options) when is_record(data) do
{pre, entries} = if function_exported?(data, :__record__, 1) do
- { "##{data.__record__(:name)} {", data.to_keywords }
+ {
+ colorize("##{data.__record__(:name)} {", data, options),
+ data.to_keywords
+ }
else
{ "{", tuple_to_list(data) }
end

0 comments on commit 0b47851

Please sign in to comment.
Something went wrong with that request. Please try again.