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.
72 73 74 |
# File 'lib/dm-core/model/hook.rb', line 72 def initialize(proc) @proc = proc.to_proc end |
Instance Method Details
#call(resource) ⇒ Object
76 77 78 |
# File 'lib/dm-core/model/hook.rb', line 76 def call(resource) resource.instance_eval(&@proc) end |
#copy(model) ⇒ Object
80 81 82 |
# File 'lib/dm-core/model/hook.rb', line 80 def copy(model) self end |