From 0a9b944526c0539ab5b9a751bb4fb766553b8177 Mon Sep 17 00:00:00 2001 From: Luis Castro Date: Fri, 2 Aug 2019 11:22:02 +0200 Subject: [PATCH] fix(timespan): add correct calls to units from argument error --- lib/timespan.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/timespan.rb b/lib/timespan.rb index 730fa2ce..edb49f8c 100644 --- a/lib/timespan.rb +++ b/lib/timespan.rb @@ -29,7 +29,7 @@ Timespan = Struct.new(:interval, :time_unit) do # timespan(1, 'minute') -> 60 # timespan(1, 'month') -> 2592000 def self.create(interval, time_unit) - raise(ArgumentError, "time_unit must be one of: #{Units}") unless Units.include?(time_unit) + raise(ArgumentError, "time_unit must be one of: #{self::Units}") unless self::Units.include?(time_unit) interval.send(time_unit.to_sym) end