Class: EacCli::Runner::ContextResponders::Set
- Defined in:
- lib/eac_cli/runner/context_responders/set.rb
Instance Attribute Summary collapse
-
#responders_names ⇒ Object
readonly
Returns the value of attribute responders_names.
Instance Method Summary collapse
- #call ⇒ Object
- #callable? ⇒ Boolean
-
#initialize(context, method_name, responders_names) ⇒ Set
constructor
A new instance of Set.
Methods inherited from Base
Constructor Details
#initialize(context, method_name, responders_names) ⇒ Set
Returns a new instance of Set.
12 13 14 15 |
# File 'lib/eac_cli/runner/context_responders/set.rb', line 12 def initialize(context, method_name, responders_names) super(context, method_name) @responders_names = responders_names end |
Instance Attribute Details
#responders_names ⇒ Object (readonly)
Returns the value of attribute responders_names.
10 11 12 |
# File 'lib/eac_cli/runner/context_responders/set.rb', line 10 def responders_names @responders_names end |
Instance Method Details
#call ⇒ Object
21 22 23 24 25 26 |
# File 'lib/eac_cli/runner/context_responders/set.rb', line 21 def call(...) caller = responder_to_call return caller.call(...) if caller raise ::NameError, "No method \"#{method_name}\" found in #{runner} or in its ancestors" end |
#callable? ⇒ Boolean
17 18 19 |
# File 'lib/eac_cli/runner/context_responders/set.rb', line 17 def callable? responders_instances.any?(&:callable?) end |