Module: RTM::IO::ToString::TopicMap

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

Instance Method Summary

Instance Method Details

- (Object) to_s(style = :short)

Returns different String representations. Try :short (default), :long, :super (original)



18
19
20
21
22
23
24
25
26
27
28
29
# File 'rtm/lib/rtm/io/to_string.rb', line 18

def to_s(style=:short)
  case style
  when :short
    "#<RTM::TopicMap id=#{id} base_locator=\"#{base_locator}\">"
  when :long
    r = " #{reifier.to_s(:short)}" if reifier
    i = " iids=#{item_identifiers.to_s}" unless item_identifiers.empty?
    "#<RTM::TopicMap id=#{id} base_locator=\"#{base_locator}\"#{r}#{i} topics:#{topics.size} associations:#{associations.size}>"
  else
    super() # these () are needed, otherwise the own parameters are passed in
  end
end