Skip to content

Commit

Permalink
Fix syntax typo for tuple
Browse files Browse the repository at this point in the history
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)`.
  • Loading branch information
ipagbox authored and ioquatix committed Jul 16, 2022
1 parent 17138ae commit 12326d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/standard/facets/tuple.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 12326d4

Please sign in to comment.