Module: RTM::AR::TOSTRING::AssociationRole

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

Instance Method Summary collapse

Instance Method Details

#to_s(style = :short) ⇒ Object



66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/rtm/activerecord/io/to_string.rb', line 66

def to_s(style=:short)
  case style
  when :short
    r = " #{reifier.to_s(:short)}" if reifier
    i = " iids=#{item_identifiers.to_s}" unless item_identifiers.empty?
    "#<RTM::AssociationRole id=#{id}#{i}#{r}>"
  when :long
    r = " #{reifier.to_s(:short)}" if reifier
    i = " iids=#{item_identifiers.to_s}" unless item_identifiers.empty?
    "#<RTM::Association id=#{id}#{i}#{r} type=#{type.to_s(:short)} player=#{player.to_s(:short)}>"
  else
    super() # these () are needed, otherwise the own parameters are passed in

  end
end