Sha256: 77f27c3cbec9f4f6a6e357b9d81e5a9eaf35e4a2319f0458f32f81d2c2df1437
Contents?: true
Size: 990 Bytes
Versions: 18
Compression:
Stored size: 990 Bytes
Contents
# frozen_striing_literal: true module Lutaml module Model module XmlAdapter class XmlNamespace # Return name # # @return [String] # # @api private attr_accessor :uri # Return prefix # # @return [String] # # @api private attr_accessor :prefix # Initialize instance # # @param [String, nil] name # @param [String, nil] prefix # # @api private def initialize(uri = nil, prefix = nil) @uri = uri @prefix = normalize_prefix(prefix) end def normalize_prefix(prefix) normalized_prefix = prefix.to_s.gsub(/xmlns:?/, "") return if normalized_prefix.empty? normalized_prefix end def attr_name if Utils.present?(prefix) "xmlns:#{prefix}" else "xmlns" end end end end end end
Version data entries
18 entries across 18 versions & 1 rubygems