Class: Reline::KeyActor::Composite
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/reline/key_actor/composite.rb |
Class Method Summary
- .new(key_actors) ⇒ Composite constructor
Instance Method Summary
Constructor Details
.new(key_actors) ⇒ Composite
# File 'lib/reline/key_actor/composite.rb', line 2
def initialize(key_actors) @key_actors = key_actors end
Instance Method Details
#get(key)
[ GitHub ]# File 'lib/reline/key_actor/composite.rb', line 10
def get(key) @key_actors.each do |key_actor| func = key_actor.get(key) return func if func end nil end
#matching?(key) ⇒ Boolean
# File 'lib/reline/key_actor/composite.rb', line 6
def matching?(key) @key_actors.any? { |key_actor| key_actor.matching?(key) } end