ruby - series

rubocop cleanup
This commit is contained in:
James Walker 2018-10-22 11:23:17 -04:00
parent 6b0ff24ee0
commit 1eb8eb0e30
Signed by: walkah
GPG Key ID: 3C127179D6086E93

View File

@ -1,12 +1,11 @@
# Series class
class Series class Series
def initialize(digits) def initialize(digits)
@digits = digits @digits = digits
end end
def slices(slice_length) def slices(slice_length)
if slice_length > @digits.length raise ArgumentError if slice_length > @digits.length
raise ArgumentError
end
slices = [] slices = []
0.upto(@digits.length - slice_length) do |i| 0.upto(@digits.length - slice_length) do |i|