Sha256: f2885fb41f042ba76d3cb3cd504059d9ef6655f0adcf77cd23a8bce13ba84711

Contents?: true

Size: 584 Bytes

Versions: 4

Compression:

Stored size: 584 Bytes

Contents

module Lutaml
  module Model
    module Type
      class Float < Value
        def self.cast(value)
          return nil if value.nil?

          value.to_f
        end

        def self.serialize(value)
          return nil if value.nil?

          cast(value)
        end

        # Instance methods for specific formats
        # xs:float format
        def to_xml
          value.to_s
        end

        def to_yaml
          value
        end

        def to_json(*_args)
          value
        end

        def to_yaml
          value
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lutaml-model-0.3.28 lib/lutaml/model/type/float.rb
lutaml-model-0.3.27 lib/lutaml/model/type/float.rb
lutaml-model-0.3.26 lib/lutaml/model/type/float.rb
lutaml-model-0.3.25 lib/lutaml/model/type/float.rb