Skip to content

Commit

Permalink
lib: dispatch act whenever it is available
Browse files Browse the repository at this point in the history
  • Loading branch information
ryancyq committed Jun 22, 2024
1 parent 740fb79 commit ca9e702
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/mime_actor/formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,17 @@ def perform_act
formatters.each do |formatter|
next unless actor = find_actor(action_name, formatter)

collector.public_send(formatter, &actor)
dispatch = unless self.class.respond_to?(:dispatch_act)
actor
else
self.class.public_send(:dispatch_act,
action: action_name.to_sym,
format: formatter.to_sym,
context: self,
&actor
)
end
collector.public_send(formatter, &dispatch)
end
end
end
Expand Down

0 comments on commit ca9e702

Please sign in to comment.