Class: R2OAS::Hooks::GlobalHook

Inherits:
Object
  • Object
show all
Defined in:
lib/r2-oas/hooks/global_hook.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(callback, once, uid, target) ⇒ GlobalHook

Returns a new instance of GlobalHook.



8
9
10
11
12
13
# File 'lib/r2-oas/hooks/global_hook.rb', line 8

def initialize(callback, once, uid, target)
  self.callback = callback
  self.once = once
  self.uid = uid
  self.target = target
end

Instance Attribute Details

#callbackObject

Returns the value of attribute callback.



6
7
8
# File 'lib/r2-oas/hooks/global_hook.rb', line 6

def callback
  @callback
end

#onceObject

Returns the value of attribute once.



6
7
8
# File 'lib/r2-oas/hooks/global_hook.rb', line 6

def once
  @once
end

#targetObject

Returns the value of attribute target.



6
7
8
# File 'lib/r2-oas/hooks/global_hook.rb', line 6

def target
  @target
end

#uidObject

Returns the value of attribute uid.



6
7
8
# File 'lib/r2-oas/hooks/global_hook.rb', line 6

def uid
  @uid
end

Instance Method Details

#call(*data) ⇒ Object



15
16
17
# File 'lib/r2-oas/hooks/global_hook.rb', line 15

def call(*data)
  callback.call(*data)
end