Class: Procto
- Inherits:
-
Module
- Object
- Module
- Procto
- Defined in:
- lib/procto.rb,
lib/procto/version.rb
Constant Summary collapse
- DEFAULT_NAME =
The default name of the instance method to be called
:call
- VERSION =
Gem version
'0.0.2'.freeze
Class Method Summary collapse
-
.call(name = DEFAULT_NAME) ⇒ Procto
Return a module that turns the host into a method object.
Instance Method Summary collapse
-
#initialize(name) ⇒ undefined
constructor
private
Initialize a new instance.
Constructor Details
#initialize(name) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Initialize a new instance
61 62 63 |
# File 'lib/procto.rb', line 61 def initialize(name) @block = ->(*args) { new(*args).public_send(name) } end |
Class Method Details
.call(name = DEFAULT_NAME) ⇒ Procto
Return a module that turns the host into a method object
49 50 51 |
# File 'lib/procto.rb', line 49 def self.call(name = DEFAULT_NAME) new(name.to_sym) end |