Method: Correlate::Correlation#direction

Defined in:
lib/correlate/correlation.rb

#directionHash

Conveniently show the ‘direction’ of the correlation in terms of classes

Returns:

  • (Hash)

    { :couchdb => :activerecord } or vice versa or couch to couch.



89
90
91
92
93
94
# File 'lib/correlate/correlation.rb', line 89

def direction
  f = source_class.ancestors.include?( CouchRest::ExtendedDocument ) ? :couchdb : :active_record
  t = target_class.ancestors.include?( CouchRest::ExtendedDocument ) ? :couchdb : :active_record

  { f => t }
end