Module: JunkDrawer::Callable::ClassMethods
- Defined in:
- lib/junk_drawer/callable.rb
Overview
ClassMethods defines a class level method call that delegates to an instance. It also causes an error to be raised if a public instance method is defined with a name other than call
Instance Method Summary collapse
Instance Method Details
#method_added(method_name) ⇒ Object
32 33 34 35 36 37 |
# File 'lib/junk_drawer/callable.rb', line 32 def method_added(method_name) return if valid_callable_method?(method_name) raise CallableError, "invalid method name #{method_name}, " \ 'only public method allowed is "call"' end |
#to_proc ⇒ Object
28 29 30 |
# File 'lib/junk_drawer/callable.rb', line 28 def to_proc new.to_proc end |