Sha256: 5a9a92ac5141733c0dd126e06b9f61fdc9376532d61f123bd35bda1e2a334b36
Contents?: true
Size: 952 Bytes
Versions: 4
Compression:
Stored size: 952 Bytes
Contents
require 'ae/basic_object' module Kernel $PRY_TABLE = {} # Pry allows you to test private and protected methods, # via a public-only interface. # # Generally one should avoid testing private and protected # method directly, instead relying on tests of public methods to # indirectly test them, because private and protected methods are # considered implementation details. But sometimes is necessary # to test them directly, or if you wish to achieve *absolute # coverage*, say in mission critical systems. # #-- # TODO: Is th cache really neccessry? #++ def pry $PRY_TABLE[self] ||= Pry.new do |op, *a, &b| __send__(op, *a, &b) end end # Pry Functor class Pry < AE::BasicObject #instance_methods.each{ |m| private m unless m.to_s =~ /^__/ } def initialize(&function) @function = function end def method_missing(op, *a, &b) @function.call(op, *a, &b) end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
ae-1.7.4 | lib/ae/pry.rb |
ae-1.7.3 | lib/ae/pry.rb |
ae-1.7.2 | lib/ae/pry.rb |
ae-1.7.1 | lib/ae/pry.rb |