lib/mixture/coerce/date.rb in mixture-0.2.0 vs lib/mixture/coerce/date.rb in mixture-0.3.0

- old
+ new

@@ -2,19 +2,19 @@ module Mixture module Coerce # Handles coercion of the Date class. class Date < Base - type Type::Date + type Types::Date - coerce_to(Type::Object, Itself) - coerce_to(Type::String, :to_s) - coerce_to(Type::Time, :to_time) - coerce_to(Type::Date, :to_date) - coerce_to(Type::DateTime, :to_datetime) - coerce_to(Type::Array) { |value| value.to_time.to_a } - coerce_to(Type::Float) { |value| value.to_time.to_f } - coerce_to(Type::Integer) { |value| value.to_time.to_i } - coerce_to(Type::Rational) { |value| value.to_time.to_r } + coerce_to(Types::Object, Itself) + coerce_to(Types::String, :to_s) + coerce_to(Types::Time, :to_time) + coerce_to(Types::Date, :to_date) + coerce_to(Types::DateTime, :to_datetime) + coerce_to(Types::Array) { |value| value.to_time.to_a } + coerce_to(Types::Float) { |value| value.to_time.to_f } + coerce_to(Types::Integer) { |value| value.to_time.to_i } + coerce_to(Types::Rational) { |value| value.to_time.to_r } end end end