Method: DataMapper::Hook::ClassMethods#hooks_with_scope

Defined in:
lib/dm-core/support/hook.rb

#hooks_with_scope(scope) ⇒ Object

Returns the correct HOOKS Hash depending on whether we are working with class methods or instance methods



140
141
142
143
144
145
146
# File 'lib/dm-core/support/hook.rb', line 140

def hooks_with_scope(scope)
  case scope
    when :class    then class_hooks
    when :instance then instance_hooks
    else raise ArgumentError, 'You need to pass :class or :instance as scope'
  end
end