Class: Called
- Inherits:
-
Object
- Object
- Called
- Defined in:
- lib/called.rb,
lib/called/version.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"0.1.0"
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(obj, path) ⇒ Called
constructor
A new instance of Called.
- #method_missing(meth, *arg, &blk) ⇒ Object
Constructor Details
#initialize(obj, path) ⇒ Called
Returns a new instance of Called.
10 11 12 13 |
# File 'lib/called.rb', line 10 def initialize obj, path @obj = obj @file = LogFile.new path end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *arg, &blk) ⇒ Object
15 16 17 18 |
# File 'lib/called.rb', line 15 def method_missing meth, *arg, &blk @file.puts Record.new meth, ::Kernel.caller[0] @obj.send meth, *arg, &blk end |
Class Method Details
.on(obj, path = {}) ⇒ Object
6 7 8 |
# File 'lib/called.rb', line 6 def self.on obj, path={} new obj, path[:log] end |