Class: Vigilem::Core::Hooks::CallbackProc

Inherits:
Proc
  • Object
show all
Includes:
Callback
Defined in:
lib/vigilem/core/hooks/callback_proc.rb

Overview

like a proc but with the added benifit of being called on in a different context essentially ‘instance_eval’

Direct Known Subclasses

MetaCallback

Instance Attribute Summary

Attributes included from Callback

#result

Instance Method Summary collapse

Methods included from Callback

#binding, #call, #evaluate, new, #to_proc

Constructor Details

#initialize(opts = {}, &block) ⇒ CallbackProc

Returns a new instance of CallbackProc.

Parameters:

  • opts (Hash) (defaults to: {})

    for meta use

  • block (Proc)

    proc to be converted to a CallbackProc



13
14
15
16
# File 'lib/vigilem/core/hooks/callback_proc.rb', line 13

def initialize(opts={}, &block)
  @options = opts
  super(&block) 
end

Instance Method Details

#optionsHash

Returns:

  • (Hash)


19
20
21
# File 'lib/vigilem/core/hooks/callback_proc.rb', line 19

def options
  @options ||= {}
end