Class: DataMapper::Model::Hook::ProcCommand
- Inherits:
-
Object
- Object
- DataMapper::Model::Hook::ProcCommand
- Defined in:
- lib/dm-core/model/hook.rb
Instance Method Summary collapse
- #call(resource) ⇒ Object
- #copy(model) ⇒ Object
-
#initialize(proc) ⇒ ProcCommand
constructor
A new instance of ProcCommand.
Constructor Details
#initialize(proc) ⇒ ProcCommand
Returns a new instance of ProcCommand.
73 74 75 |
# File 'lib/dm-core/model/hook.rb', line 73 def initialize(proc) @proc = proc.to_proc end |
Instance Method Details
#call(resource) ⇒ Object
77 78 79 |
# File 'lib/dm-core/model/hook.rb', line 77 def call(resource) resource.instance_eval(&@proc) end |
#copy(model) ⇒ Object
81 82 83 |
# File 'lib/dm-core/model/hook.rb', line 81 def copy(model) self end |