Module: Correlate::ClassMethods
- Defined in:
- lib/correlate.rb
Instance Method Summary collapse
-
#correlation_for(object) ⇒ Correlate::Correlation?
Determine the matching correlation for the provided object.
- #correlations ⇒ Object
-
#related_to(&block) ⇒ Object
Depending on the containing class, this method configures either a Correlate::Relationships::CouchRest or a Correlate::Relationships::ActiveRecord.
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 |
#correlations ⇒ Object
84 85 86 |
# File 'lib/correlate.rb', line 84 def correlations @correlations ||= [] end |
#related_to(&block) ⇒ Object
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 ( &block ) Correlate::Relationships.configure!( self, &block ) end |