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.
27 28 29 30 |
# File 'lib/xsd/ns.rb', line 27 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.
25 26 27 |
# File 'lib/xsd/ns.rb', line 25 def known_tag @known_tag end |
Instance Method Details
#assign(ns) ⇒ Object
32 33 34 35 36 37 38 |
# File 'lib/xsd/ns.rb', line 32 def assign(ns) if @known_tag.key?(ns) return @known_tag[ns] end @count += 1 "n#{@count}" end |