Sha256: c19bc4b9d754a50d937ec3887a50a0a48f8432857b88217cbb597850b71851b9

Contents?: true

Size: 236 Bytes

Versions: 39

Compression:

Stored size: 236 Bytes

Contents

module Scope

  def scope(method_name, proc)
    singleton_class.class_eval do
      params = Reparameterize.call(proc.parameters)
      block = eval("lambda { |#{params}| }")
      define_method(method_name, block)
    end
  end

end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
active_mocker-1.3.2 lib/active_mocker/active_record/scope.rb
active_mocker-1.3.1 lib/active_mocker/active_record/scope.rb
active_mocker-1.3 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.4 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.3 lib/active_mocker/active_record/scope.rb
active_mocker-1.2 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.pre.11 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.pre.10 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.pre.9 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.pre.8 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.pre.7 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.pre.6 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.pre.5 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.pre.4 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.pre.3 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.pre.2 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.pre.1 lib/active_mocker/active_record/scope.rb
active_mocker-1.2.pre lib/active_mocker/active_record/scope.rb
active_mocker-1.1.23 lib/active_mocker/active_record/scope.rb
active_mocker-1.1.22 lib/active_mocker/active_record/scope.rb