Sha256: e89a2eaaf09c042aeab56c12cc7ae5403a30ca49b718664664fb1612a8ae8657

Contents?: true

Size: 162 Bytes

Versions: 21

Compression:

Stored size: 162 Bytes

Contents

class Sum
  def initialize(start_num, end_num)
    @num = [start_num, end_num]
  end

  def exec
    (@num[0]..@num[1]).inject(0) { |sum, i| sum += i }
  end
end

Version data entries

21 entries across 17 versions & 1 rubygems

Version Path
drbqs-0.1.1 examples/sum2/sum.rb
drbqs-0.1.1 examples/group/sum.rb
drbqs-0.1.0 examples/group/sum.rb
drbqs-0.1.0 examples/sum2/sum.rb
drbqs-0.0.19 example/group/sum.rb
drbqs-0.0.19 example/sum2/sum.rb
drbqs-0.0.18 example/group/sum.rb
drbqs-0.0.18 example/sum2/sum.rb
drbqs-0.0.17 example/sum2/sum.rb
drbqs-0.0.16 example/sum2/sum.rb
drbqs-0.0.15 example/sum2/sum.rb
drbqs-0.0.14 example/sum2/sum.rb
drbqs-0.0.13 example/sum2/sum.rb
drbqs-0.0.12 example/sum2/sum.rb
drbqs-0.0.11 example/sum2/sum.rb
drbqs-0.0.10 example/sum2/sum.rb
drbqs-0.0.9 example/sum2/sum.rb
drbqs-0.0.8 example/sum2/sum.rb
drbqs-0.0.7 example/sum/sum.rb
drbqs-0.0.6 example/sum/sum.rb