lib/hanami/interactor.rb in hanami-utils-0.9.2 vs lib/hanami/interactor.rb in hanami-utils-1.0.0.beta1

- old
+ new

@@ -35,11 +35,11 @@ # @return [Hanami::Interactor::Result] # # @since 0.3.5 # @api private def initialize(payload = {}) - @payload = _payload(payload) + @payload = payload @errors = [] @success = true end # Check if the current status is successful @@ -123,11 +123,11 @@ # @param payload [Hash] an updated payload # # @since 0.3.5 # @api private def prepare!(payload) - @payload.merge!(_payload(payload)) + @payload.merge!(payload) self end protected @@ -144,16 +144,10 @@ METHODS[method_name] || @payload.key?(method_name) end # @since 0.3.5 # @api private - def _payload(payload) - Utils::Hash.new(payload).symbolize! - end - - # @since 0.3.5 - # @api private def __inspect " @success=#{@success} @payload=#{@payload.inspect}" end end @@ -490,11 +484,11 @@ def self.extended(interactor) interactor.class_eval do include Utils::ClassAttribute class_attribute :exposures - self.exposures = Utils::Hash.new + self.exposures = {} end end # Expose local instance variables into the returning value of <tt>#call</tt> # @@ -525,10 +519,10 @@ # # result.user # => #<User:0x007fa85c58ccd8 @name="Luca"> # result.params # => NoMethodError def expose(*instance_variable_names) instance_variable_names.each do |name| - exposures[name] = "@#{name}" + exposures[name.to_sym] = "@#{name}" end end end end