Module: Correlate::ClassMethods

Defined in:
lib/correlate.rb

Instance Method Summary collapse

Instance Method Details

#correlation_for(object) ⇒ Correlate::Correlation?

Determine the matching correlation for the provided object.



91
92
93
# File 'lib/correlate.rb', line 91

def correlation_for( object )
  self.correlations.detect { |c| c.matches?( object ) }
end

#correlationsObject



84
85
86
# File 'lib/correlate.rb', line 84

def correlations
  @correlations ||= []
end

Depending on the containing class, this method configures either a Correlate::Relationships::CouchRest or a Correlate::Relationships::ActiveRecord.



79
80
81
# File 'lib/correlate.rb', line 79

def related_to( &block )
  Correlate::Relationships.configure!( self, &block )
end