Sha256: d36d9c1db2747b36e530d79699905790e29ad9d8ae580cbf22a2de0219c29b58

Contents?: true

Size: 363 Bytes

Versions: 4

Compression:

Stored size: 363 Bytes

Contents

# lib/lutaml/model/type/time_without_date.rb
module Lutaml
  module Model
    module Type
      class TimeWithoutDate
        def self.cast(value)
          parsed_time = ::Time.parse(value.to_s)
          parsed_time.strftime("%H:%M:%S")
        end

        def self.serialize(value)
          value.strftime("%H:%M:%S")
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lutaml-model-0.3.1 lib/lutaml/model/type/time_without_date.rb
lutaml-model-0.3.0 lib/lutaml/model/type/time_without_date.rb
lutaml-model-0.2.1 lib/lutaml/model/type/time_without_date.rb
lutaml-model-0.1.0 lib/lutaml/model/type/time_without_date.rb