fix(timespan): add correct calls to units from argument error
This commit is contained in:
parent
3965ba59f9
commit
0a9b944526
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue