Module: Commande::ClassMethods Private
- Defined in:
- lib/commande.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .extended(interactor) ⇒ Object private
Instance Method Summary collapse
- #call(*args, &block) ⇒ Object private
- #method_added(method_name) ⇒ Object private
-
#output(*instance_variable_names) ⇒ Object
private
Expose local instance variables into the returning value of
#call.
Class Method Details
.extended(interactor) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
408 409 410 411 412 413 414 415 416 |
# File 'lib/commande.rb', line 408 def self.extended(interactor) interactor.class_eval do singleton_class.class_eval do attr_accessor(:outputs) end self.outputs = {} end end |
Instance Method Details
#call(*args, &block) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
403 404 405 |
# File 'lib/commande.rb', line 403 def call(*args, &block) new.call(*args, &block) end |
#method_added(method_name) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
418 419 420 421 422 423 |
# File 'lib/commande.rb', line 418 def method_added(method_name) super return unless method_name == :call prepend Commande::Interface end |
#output(*instance_variable_names) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Expose local instance variables into the returning value of #call
432 433 434 435 436 |
# File 'lib/commande.rb', line 432 def output(*instance_variable_names) instance_variable_names.each do |name| outputs[name.to_sym] = "@#{name}" end end |