Module: RTM::AR::IO::TOJTM::AssociationRole

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

Instance Method Summary collapse

Instance Method Details

#to_jtm(*a) ⇒ Object Also known as: to_json



117
118
119
# File 'lib/rtm/activerecord/io/to_jtm.rb', line 117

def to_jtm(*a)
  to_jtm_hash.to_json(*a)
end

#to_jtm_hash(*a) ⇒ Object



109
110
111
112
113
114
115
116
# File 'lib/rtm/activerecord/io/to_jtm.rb', line 109

def to_jtm_hash(*a)
  j={}
  j['reifier'] = reifier.to_jtm_ref if reifier
  j['item_identifiers'] = item_identifiers.map{|i| i.reference} unless item_identifiers.empty?
  j['player'] = player.to_jtm_ref if player
  j['type'] = type.to_jtm_ref if type
  j
end