Module: RTM::IO::TOXTM2::AssociationRole

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

Instance Method Summary

Instance Method Details

- (Object) to_xtm2



136
137
138
139
140
141
142
143
144
145
# File 'rtm/lib/rtm/io/to_xtm2.rb', line 136

def to_xtm2
  warn("TOXTM2: Warning: outputting invalid AssociationRole #{self}") unless valid?
  # role = element role { reifiable, type, topicRef }
  x = REXML::Element.new 'role'
  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 << player.to_xtm2_ref if player
  x
end