Sha256: f8ff4dab8b8bd868403b561488d7b301676f9bc8a5b8745b6c97a1bff4c6b12c

Contents?: true

Size: 463 Bytes

Versions: 393

Compression:

Stored size: 463 Bytes

Contents

defmodule Clock do
  defstruct hour: 0, minute: 0

  @doc """
  Returns a string representation of a clock:

      iex> Clock.new(8, 9) |> to_string
      "08:09"
  """
  @spec new(integer, integer) :: Clock
  def new(hour, minute) do
  end

  @doc """
  Adds two clock times:

      iex> Clock.add(10, 0) |> Clock.add(3) |> to_string
      "10:03"
  """
  @spec add(Clock, integer) :: Clock
  def add(%Clock{hour: hour, minute: minute}, add_minute) do
  end
end

Version data entries

393 entries across 393 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.179 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.178 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.177 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.176 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.175 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.174 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.173 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.172 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.171 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.170 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.169 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.167 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.166 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.165 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.164 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.163 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.162 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.161 tracks/elixir/exercises/clock/clock.exs
trackler-2.2.1.160 tracks/elixir/exercises/clock/clock.exs