Module: RTM::AR::IO::TOXTM1::AssociationRole

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

Instance Method Summary collapse

Instance Method Details

#to_xtm1Object



134
135
136
137
138
139
140
141
142
143
# File 'lib/rtm/activerecord/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