Module: RTM::AR::IO::TOXTM2::TopicName
- Defined in:
- lib/rtm/activerecord/io/to_xtm2.rb
Instance Method Summary collapse
Instance Method Details
#to_xtm2 ⇒ Object
105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/rtm/activerecord/io/to_xtm2.rb', line 105 def to_xtm2 warn("TOXTM2: Warning: outputting invalid TopicName #{self}") unless valid? # name = element name { reifiable, type?, scope?, value, variant* } x = REXML::Element.new 'name' x.add_attribute('reifier', reifier.xtm2_id) if reifier item_identifiers.each { |ii| x << TOXTM2.locator(ii) } # itemIdentity x << TOXTM2.type(type) if type x << TOXTM2.scope(scope) unless scope.empty? (x << REXML::Element.new('value')).text = value # adds the value within a value-element variants.each { |v| x << v.to_xtm2 } x end |