Module: ActsAsCleoConnection::ActsMethods

Included in:
ActsAsCleoConnection
Defined in:
lib/acts_as_cleo_connection/acts_methods.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_cleo_connection(opts = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/acts_as_cleo_connection/acts_methods.rb', line 3

def acts_as_cleo_connection(opts = {})
  #push in Instance Methods
  include InstanceMethods

  after_create :create_cleo_connection
  after_update :update_cleo_connection
  before_destroy :remove_cleo_connection

  #Target and Origin calls
  cattr_accessor :cleo_target
  cattr_accessor :cleo_origin
  cattr_accessor :cleo_type
  cattr_accessor :cleo_strength

  #Set taggign calls
  self.cleo_origin = opts[:origin]
  self.cleo_target = opts[:target]
  self.cleo_type = opts[:type]
  self.cleo_strength = opts[:strengh]
end