Sha256: f8bf4354e5b8c4345fa58fcf1a09d20af45a08ff3eb244e4d1eb4fd9f2444b80

Contents?: true

Size: 344 Bytes

Versions: 23

Compression:

Stored size: 344 Bytes

Contents

require "date"

module Lutaml
  module Model
    module Type
      # Date and time representation
      class DateTime
        def self.cast(value)
          return if value.nil?

          ::DateTime.parse(value.to_s).new_offset(0)
        end

        def self.serialize(value)
          value.iso8601
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
lutaml-model-0.3.24 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.23 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.22 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.21 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.20 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.19 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.18 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.17 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.16 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.15 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.14 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.13 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.12 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.11 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.10 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.9 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.8 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.7 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.6 lib/lutaml/model/type/date_time.rb
lutaml-model-0.3.5 lib/lutaml/model/type/date_time.rb