Module: RTM::IO::ToHash::TopicMap
- Defined in:
- lib/rtm/io/to_hash.rb
Instance Method Summary collapse
-
#to_hash ⇒ Object
Returns the Hash representation of this topic map.
Instance Method Details
#to_hash ⇒ Object
Returns the Hash representation of this topic map.
The returned Hash holds information about the :reifier, the :item_identifiers, the :topics and :associations.
:call-seq:
to_hash -> Hash
18 19 20 21 22 23 24 25 |
# File 'lib/rtm/io/to_hash.rb', line 18 def to_hash h={} h[:reifier] = reifier.reference if reifier h[:item_identifiers] = item_identifiers.map{|i| i.reference} unless item_identifiers.empty? h[:topics] = topics.map{|i| i.to_hash} unless topics.empty? h[:associations] = associations.map{|i| i.to_hash} unless associations.empty? h end |