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