From d46e2846481bf1191c492edf15b1b643b0ac8f66 Mon Sep 17 00:00:00 2001 From: Joel Drapper Date: Wed, 11 Jan 2023 09:00:28 +0000 Subject: [PATCH] Use new `...` argument forwarding --- .ruby-version | 1 + lib/phlex/buffered.rb | 4 ++-- lib/phlex/html.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 .ruby-version diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 00000000..944880fa --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +3.2.0 diff --git a/lib/phlex/buffered.rb b/lib/phlex/buffered.rb index 58607aa3..18b0a23a 100644 --- a/lib/phlex/buffered.rb +++ b/lib/phlex/buffered.rb @@ -10,8 +10,8 @@ def initialize(object, buffer:) end # Alias output methods to this - def __output_method__(*args, **kwargs, &block) - output = __getobj__.public_send(__callee__, *args, **kwargs, &block) + def __output_method__(...) + output = __getobj__.public_send(__callee__, ...) @buffer << output if output.is_a? String nil end diff --git a/lib/phlex/html.rb b/lib/phlex/html.rb index d10f81ec..de42625a 100644 --- a/lib/phlex/html.rb +++ b/lib/phlex/html.rb @@ -159,7 +159,7 @@ def call(buffer = +"", view_context: nil, parent: nil, &block) buffer end - def render(renderable, *args, **kwargs, &block) + def render(renderable, &block) case renderable when Phlex::HTML renderable.call(@_target, view_context: @_view_context, parent: self, &block)