Class: XSD::NS::Assigner
Instance Attribute Summary collapse
-
#known_tag ⇒ Object
readonly
Returns the value of attribute known_tag.
Instance Method Summary collapse
- #assign(ns) ⇒ Object
-
#initialize(known_tag) ⇒ Assigner
constructor
A new instance of Assigner.
Constructor Details
#initialize(known_tag) ⇒ Assigner
Returns a new instance of Assigner.
26 27 28 29 |
# File 'lib/xsd/ns.rb', line 26 def initialize(known_tag) @known_tag = known_tag.dup @count = 0 end |
Instance Attribute Details
#known_tag ⇒ Object (readonly)
Returns the value of attribute known_tag.
24 25 26 |
# File 'lib/xsd/ns.rb', line 24 def known_tag @known_tag end |
Instance Method Details
#assign(ns) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/xsd/ns.rb', line 31 def assign(ns) if @known_tag.key?(ns) return @known_tag[ns] end @count += 1 "n#{@count}" end |