Module: RTM::IO::TOXTM2::Variant

Defined in:
rtm/lib/rtm/io/to_xtm2.rb

Instance Method Summary

Instance Method Details

- (Object) to_xtm2



149
150
151
152
153
154
155
156
157
158
# File 'rtm/lib/rtm/io/to_xtm2.rb', line 149

def to_xtm2
  warn("TOXTM2: Warning: outputting invalid Variant #{self}") unless valid?
  # variant = element variant { reifiable, scope, (resourceRef | resourceData) }
  x = REXML::Element.new 'variant'
  x.add_attribute('reifier', reifier.xtm2_id) if reifier
  item_identifiers.each { |ii| x << TOXTM2.locator(ii) } # itemIdentity
  x << TOXTM2.scope(scope)
  x << TOXTM2.value(datatype, value)
  x
end