Module: RTM::IO::TOXTM1::Role

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

Instance Method Summary

Instance Method Details

- (Object) to_xtm1



134
135
136
137
138
139
140
141
142
143
# File 'rtm/lib/rtm/io/to_xtm1.rb', line 134

def to_xtm1
  warn("TOXTM1: Warning: outputting invalid AssociationRole #{self}") unless valid?
  # role = element role { reifiable, type, topicRef }
  x = REXML::Element.new 'role'
  x.add_attribute('reifier', reifier.xtm1_id) if reifier
  item_identifiers.each { |ii| x << TOXTM1.ii(ii) } # itemIdentity
  x << TOXTM1.type(type) if type
  x << player.to_xtm1_ref if player
  x
end