Module: Hanami::ClassMethods Private
- Defined in:
- lib/hanami/interactor.rb
Overview
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
-
#expose(*instance_variable_names) ⇒ Object
private
Exposes local instance variables into the returning value of
#call
. - #method_added(method_name) ⇒ Object private
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.
567 568 569 570 571 572 573 574 |
# File 'lib/hanami/interactor.rb', line 567 def self.extended(interactor) interactor.class_eval do include Utils::ClassAttribute class_attribute :exposures self.exposures = {} end end |
Instance Method Details
#expose(*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.
Exposes local instance variables into the returning value of #call
616 617 618 619 620 |
# File 'lib/hanami/interactor.rb', line 616 def expose(*instance_variable_names) instance_variable_names.each do |name| exposures[name.to_sym] = "@#{name}" end 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.
576 577 578 579 580 581 582 583 584 585 |
# File 'lib/hanami/interactor.rb', line 576 def method_added(method_name) super return unless method_name == :call if instance_method(:call).arity.zero? prepend Hanami::Interactor::LegacyInterface else prepend Hanami::Interactor::Interface end end |