Sha256: 5bb31b255748f0fd548af3e230f25a1e591445210f9fa9163452b978d4b6ee58

Contents?: true

Size: 175 Bytes

Versions: 24

Compression:

Stored size: 175 Bytes

Contents

module Unit
  module Types
    class DateTime
      def self.cast(value)
        return nil if value.nil?

        ::DateTime.parse(value).iso8601
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
unit-ruby-0.10.0 lib/unit-ruby/types/date_time.rb
unit-ruby-0.9.0 lib/unit-ruby/types/date_time.rb
unit-ruby-0.8.1 lib/unit-ruby/types/date_time.rb
unit-ruby-0.8.0 lib/unit-ruby/types/date_time.rb
unit-ruby-0.7.0 lib/unit-ruby/types/date_time.rb
unit-ruby-0.6.0 lib/unit-ruby/types/date_time.rb
unit-ruby-0.5.0 lib/unit-ruby/types/date_time.rb
unit-ruby-0.4.3 lib/unit-ruby/types/date_time.rb
unit-ruby-0.4.2 lib/unit-ruby/types/date_time.rb
unit-ruby-0.4.1 lib/unit-ruby/types/date_time.rb
unit-ruby-0.4.0 lib/unit-ruby/types/date_time.rb
unit-ruby-0.3.7 lib/unit-ruby/types/date_time.rb
unit-ruby-0.2.7 lib/unit-ruby/types/date_time.rb
unit-ruby-0.2.6 lib/unit-ruby/types/date_time.rb
unit-ruby-0.2.5 lib/unit-ruby/types/date_time.rb
unit-ruby-0.2.4 lib/unit-ruby/types/date_time.rb
unit-ruby-0.2.3 lib/unit-ruby/types/date_time.rb
unit-ruby-0.2.2 lib/unit-ruby/types/date_time.rb
unit-ruby-0.2.1 lib/unit-ruby/types/date_time.rb
unit-ruby-0.2.0 lib/unit-ruby/types/date_time.rb