Sha256: 86ef8dda8ff4e3a45ff909e3d01c17dcb0d09d2a443938e6c588076a39daf14f

Contents?: true

Size: 509 Bytes

Versions: 12

Compression:

Stored size: 509 Bytes

Contents

# encoding: utf-8

module Mixture
  module Coerce
    # Handles coercion of the Time class.
    class Time < Base
      type Types::Time

      coerce_to(Types::Object, Itself)
      coerce_to(Types::String, :to_s)
      coerce_to(Types::Integer, :to_i)
      coerce_to(Types::Float, :to_f)
      coerce_to(Types::Rational, :to_r)
      coerce_to(Types::Array, :to_a)
      coerce_to(Types::Time, Itself)
      coerce_to(Types::Date, :to_date)
      coerce_to(Types::DateTime, :to_datetime)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mixture-0.6.2 lib/mixture/coerce/time.rb
mixture-0.6.1 lib/mixture/coerce/time.rb
mixture-0.6.0 lib/mixture/coerce/time.rb
mixture-0.5.1 lib/mixture/coerce/time.rb
mixture-0.5.0 lib/mixture/coerce/time.rb
mixture-0.4.0 lib/mixture/coerce/time.rb
mixture-0.3.6 lib/mixture/coerce/time.rb
mixture-0.3.5 lib/mixture/coerce/time.rb
mixture-0.3.4 lib/mixture/coerce/time.rb
mixture-0.3.2 lib/mixture/coerce/time.rb
mixture-0.3.1 lib/mixture/coerce/time.rb
mixture-0.3.0 lib/mixture/coerce/time.rb