Skip to content

Commit

Permalink
Simplify lambda slot call (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephannv authored Feb 15, 2024
1 parent bfad7a1 commit 2ce5e61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/phlex/slotable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def callable_value(slot_name, callable)
when nil
%(block)
when Proc
%(-> { self.class.instance_method(:"__call_#{slot_name}__").bind_call(self, *args, **kwargs, &block) })
%(-> { __call_#{slot_name}__(*args, **kwargs, &block) })
else
%(#{callable}.new(*args, **kwargs, &block))
end
Expand Down

0 comments on commit 2ce5e61

Please sign in to comment.