Class: Proc::Callable
- Inherits:
-
Object
- Object
- Proc::Callable
- Defined in:
- lib/proc/callable.rb
Instance Attribute Summary collapse
-
#proc ⇒ Object
readonly
Returns the value of attribute proc.
Instance Method Summary collapse
- #>>(callable) ⇒ Object
- #call(input = nil, **arguments) ⇒ Object
-
#initialize(proc, client:) ⇒ Callable
constructor
A new instance of Callable.
Constructor Details
#initialize(proc, client:) ⇒ Callable
7 8 9 10 |
# File 'lib/proc/callable.rb', line 7 def initialize(proc, client:) @proc = proc @client = client end |
Instance Attribute Details
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
5 6 7 |
# File 'lib/proc/callable.rb', line 5 def proc @proc end |
Instance Method Details
#>>(callable) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/proc/callable.rb', line 16 def >>(callable) composed = Composition.new(client: @client) composed << self composed << callable composed end |
#call(input = nil, **arguments) ⇒ Object
12 13 14 |
# File 'lib/proc/callable.rb', line 12 def call(input = nil, **arguments) @client.perform(@proc, input, **arguments) end |