Module: RTM::IO::TOXTM1::Variant

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

Instance Method Summary

Instance Method Details

- (Object) to_xtm1



147
148
149
150
151
152
153
154
155
156
# File 'rtm/lib/rtm/io/to_xtm1.rb', line 147

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