Class: BootyCall::Callbacker

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

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ Callbacker

Returns a new instance of Callbacker.



5
6
7
8
# File 'lib/booty_call/callbacker.rb', line 5

def initialize(klass)
  @klass = klass
  extend_klass
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



3
4
5
# File 'lib/booty_call/callbacker.rb', line 3

def klass
  @klass
end

Instance Method Details

#after(method_id, *symbols, &block) ⇒ Object



14
15
16
# File 'lib/booty_call/callbacker.rb', line 14

def after(method_id, *symbols, &block)
  add_callback(:after, method_id, *symbols, &block)
end

#around(method_id, *symbols, &block) ⇒ Object



18
19
20
# File 'lib/booty_call/callbacker.rb', line 18

def around(method_id, *symbols, &block)
  add_callback(:around, method_id, *symbols, &block)
end

#before(method_id, *symbols, &block) ⇒ Object



10
11
12
# File 'lib/booty_call/callbacker.rb', line 10

def before(method_id, *symbols, &block)
  add_callback(:before, method_id, *symbols, &block)
end