Module: RTM::IO::ToHash::Role

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

Instance Method Summary collapse

Instance Method Details

#to_hashObject

Returns the Hash representation of this role.

The returned Hash holds information about the :reifier, the :item_identifiers, the :player, and the :type.

:call-seq:

to_hash -> Hash


122
123
124
125
126
127
128
129
# File 'lib/rtm/io/to_hash.rb', line 122

def to_hash
  h={}
  h[:reifier] = reifier.reference if reifier
  h[:item_identifiers] = item_identifiers.map{|i| i.reference} unless item_identifiers.empty?
  h[:player] = player.reference if player
  h[:type] = type.reference if type
  h
end