Class: Proc::Callable

Inherits:
Object
  • Object
show all
Defined in:
lib/proc/callable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#procObject (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