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.
9 10 11 12 |
# File 'lib/eac_cli/runner/context_responders/set.rb', line 9 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.
7 8 9 |
# File 'lib/eac_cli/runner/context_responders/set.rb', line 7 def responders_names @responders_names end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 |
# File 'lib/eac_cli/runner/context_responders/set.rb', line 18 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
14 15 16 |
# File 'lib/eac_cli/runner/context_responders/set.rb', line 14 def callable? responders_instances.any?(&:callable?) end |