Sha256: 6d9c3cb3e7db1f6c259280ef247a5600ef442a2a0adb27797b7cd932b4d824b1

Contents?: true

Size: 555 Bytes

Versions: 13

Compression:

Stored size: 555 Bytes

Contents

require_relative "../lib/procemon.rb"

class TestT

  def self.test
    puts self
  end

  def test string
    puts self,string
  end

end

TestT.inject_instance_method :test do |str|

  puts "hello world! instance "+str

end

TestT.inject_singleton_method :test, add: "after" do
  puts "hello world! singleton"
end

puts "---\nafter,singleton case:"
TestT.test

puts "---\nbefore,instance case:"
TestT.new.test "boogie man"


#after,singleton case:
#TestT
#hello world! singleton
#
#before,instance case:
#hello world! instance
##<TestT:0x00000000d4a008>

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
procemon-1.2.1 examples/how_to_inject_with_extra_process_a_method.rb
procemon-1.2.0 examples/how_to_inject_with_extra_process_a_method.rb
procemon-1.1.1 examples/how_to_inject_with_extra_process_a_method.rb
procemon-1.0.4 examples/how_to_inject_with_extra_process_a_method.rb
procemon-1.0.3 examples/how_to_inject_with_extra_process_a_method.rb
procemon-1.0.1 examples/how_to_inject_with_extra_process_a_method.rb
procemon-1.0.0 examples/how_to_inject_with_extra_process_a_method.rb
procemon-0.9.1 examples/how_to_inject_with_extra_process_a_method.rb
procemon-0.9.0 examples/how_to_inject_with_extra_process_a_method.rb
procemon-0.8.1 examples/how_to_inject_with_extra_process_a_method.rb
procemon-0.8.0 examples/how_to_inject_with_extra_process_a_method.rb
procemon-0.7.0 examples/how_to_inject_with_extra_process_a_method.rb
procemon-0.6.3 examples/how_to_inject_with_extra_process_a_method.rb