Module: RTM::IO::ToHash::Association
- Defined in:
- lib/rtm/io/to_hash.rb
Instance Method Summary collapse
-
#to_hash ⇒ Object
Returns the Hash representation of this association.
Instance Method Details
#to_hash ⇒ Object
Returns the Hash representation of this association.
The returned Hash holds information about the :reifier, the :item_identifiers, the :type, the :scope and the :roles.
:call-seq:
to_hash -> Hash
80 81 82 83 84 85 86 87 88 |
# File 'lib/rtm/io/to_hash.rb', line 80 def to_hash h={} h[:reifier] = reifier.reference if reifier h[:item_identifiers] = item_identifiers.map{|i| i.reference} unless item_identifiers.empty? h[:type] = type.reference if type h[:scope] = scope.map{|i| i.reference} unless scope.empty? h[:roles] = roles.map{|i| i.to_hash} unless roles.empty? h end |