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

- old
+ new

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