From 12326d4767bd109bdf5f9fa3582797bd88c36d30 Mon Sep 17 00:00:00 2001 From: Igor Prudnikov Date: Wed, 6 Jul 2022 15:14:11 +0500 Subject: [PATCH] Fix syntax typo for tuple Hello! Ruby does not have `elseif` operator. So in this case when `block_given?` is `true` this part is interpreted as method call like `elsif(Integer === arg)`. --- lib/standard/facets/tuple.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/standard/facets/tuple.rb b/lib/standard/facets/tuple.rb index b29f8fd1..031218e0 100644 --- a/lib/standard/facets/tuple.rb +++ b/lib/standard/facets/tuple.rb @@ -42,7 +42,7 @@ def self.multiton_id(arg=0, default=0, &block) if block_given? values = [] arg.times { |i| values << block[i] } - elseif Integer === arg + elsif Integer === arg values = [ default ] * arg else values = arg.to_ary @@ -54,7 +54,7 @@ def initialize(arg=0, default=0, &blk) if block_given? @values = [] arg.times { |i| @values << blk[i] } - elseif Integer === arg + elsif Integer === arg @values = [ default ] * arg else @values = arg.to_ary