Class: ActsInRelation::Core::Relation
- Inherits:
-
Object
- Object
- ActsInRelation::Core::Relation
- Defined in:
- lib/acts_in_relation/core.rb
Instance Method Summary collapse
- #define ⇒ Object
-
#initialize(position, params, class_name) ⇒ Relation
constructor
A new instance of Relation.
Constructor Details
#initialize(position, params, class_name) ⇒ Relation
Returns a new instance of Relation.
22 23 24 25 26 |
# File 'lib/acts_in_relation/core.rb', line 22 def initialize(position, params, class_name) @position = position @params = params @class_name = class_name end |
Instance Method Details
#define ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/acts_in_relation/core.rb', line 28 def define positions = (@position == :self) ? [:source, :target] : [@position] positions.each do |position| extend "ActsInRelation::#{position.capitalize}".constantize define end end |