class MethodCallbacks::Method

Constants

ALIAS_PREFIX

Attributes

name[R]

Public Class Methods

new(name) click to toggle source
# File lib/method_callbacks/method.rb, line 17
def initialize(name)
  @name = name
end

Public Instance Methods

==(other) click to toggle source
# File lib/method_callbacks/method.rb, line 21
def ==(other)
  self.name == other.name
end
alias() click to toggle source
# File lib/method_callbacks/method.rb, line 25
def alias
  "#{ALIAS_PREFIX}_#{name}"
end
callbacks(type) click to toggle source
# File lib/method_callbacks/method.rb, line 29
def callbacks(type)
  @_callbacks ||= {}
  @_callbacks[type] ||= []
end
execute(type, object) click to toggle source
# File lib/method_callbacks/method.rb, line 34
def execute(type, object)
  block_given? ? executor(type, object).execute(&Proc.new) : executor(type, object).execute
end

Private Instance Methods

definer() click to toggle source
# File lib/method_callbacks/method.rb, line 44
def definer
  @_definer ||= Definer.new(self)
end
executor(type, object) click to toggle source
# File lib/method_callbacks/method.rb, line 40
def executor(type, object)
  Executor.new(self, type, object)
end
locker() click to toggle source
# File lib/method_callbacks/method.rb, line 48
def locker
  @_method_lock ||= Locker.new
end