     @('year: year, 'month: month, 'day: day)
   end
 
+  % Return a string representation of the Date object.
+  %
+  % ## Example
+  %
+  %     date = Date.new(2012, 12, 21)
+  %     date.inspect % => 2012-12-21
+  %
   def inspect
     "#{@year}-#{convert_to_double_digit(@month)}-#{convert_to_double_digit(@day)}"
   end

    inspect
  end

  def leap_year?
    Erlang.calendar.is_leap_year(@year)
  end

  def tomorrow
    gregorian_addition(1)
  end

  def yesterday
    gregorian_addition(-1)
  end

  def -(days)
    gregorian_addition(-days)
  end

  def +(days)
    gregorian_addition(days)
  end

  def to_tuple
   {@year, @month, @day}
  end

% elixir: cache

% Date represents dates, with years, months, and days. Date has no concept of timezones, while DateTime does(but not currently).
% 
%
% This implementation is based on Erlang's date BIF: http://www.erlang.org/doc/man/erlang.html#date-0
object Date

  attr_reader ['day, 'month, 'year]

  module Mixin
    % Return the current date according to the operating system.
    def today
      Date.new(Erlang.date)
    end

    % Return the tomorrow's date according to the operating system.
    def tomorrow
      Date.today.tomorrow
    end

    % Return the yesterday's date according to the operating system.
    def yesterday
      Date.today.yesterday
    end

    % Return the number of days in the month in *date*.
    def days_in_month(date)
      if [1,3,5,7,8,10,12].member?(date.month)
        31
