Class: CentralNotifications::Registration

Inherits:
Object
  • Object
show all
Defined in:
lib/registration.rb

Constant Summary collapse

NOTIFIER_CLASS_VARIABLE =
:@@_____notifier

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Registration

Returns a new instance of Registration.



6
7
8
# File 'lib/registration.rb', line 6

def initialize(args={})
  @notifier = args[:notifier]
end

Instance Attribute Details

#klassObject

Returns the value of attribute klass.



4
5
6
# File 'lib/registration.rb', line 4

def klass
  @klass
end

#methodObject

Returns the value of attribute method.



4
5
6
# File 'lib/registration.rb', line 4

def method
  @method
end

#resultObject

Returns the value of attribute result.



4
5
6
# File 'lib/registration.rb', line 4

def result
  @result
end

Instance Method Details

#forkObject



10
11
12
13
14
15
16
# File 'lib/registration.rb', line 10

def fork
  @real_klass = singleton_method? ? (class << klass; self end) : klass 
  @original_alias_symbol = original_alias_symbol
  return if already_registered?
  set_notifier_in_notifier_class
  redefine_orinal_method
end