Class: Concurrent::Channel::Selector::DefaultClause

Inherits:
Object
  • Object
show all
Defined in:
lib/concurrent-ruby-edge/concurrent/channel/selector/default_clause.rb

Instance Method Summary collapse

Constructor Details

#initialize(block) ⇒ DefaultClause

Returns a new instance of DefaultClause.



9
10
11
# File 'lib/concurrent-ruby-edge/concurrent/channel/selector/default_clause.rb', line 9

def initialize(block)
  @block = block
end

Instance Method Details

#executeObject



13
14
15
# File 'lib/concurrent-ruby-edge/concurrent/channel/selector/default_clause.rb', line 13

def execute
  Concurrent::Maybe.just(@block.call)
end