Sha256: 28e2732df923f431a243b85f3fa55373c06d8dbe073ee4fc63b8b04f51fb0a7a

Contents?: true

Size: 416 Bytes

Versions: 31

Compression:

Stored size: 416 Bytes

Contents

# prob-1.rb
# Write a MathService module that has a method that can sum an Array of Numbers
# It should raise an exception if not given an Array.
# It should raise an exception if any elements are not Numeric.

module MathService
  def sum array_of_numbers
    # ???
  end
  extend self
end

######################################################################

begin
  puts MathService.sum([1, 2, 3]) # => 6
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
asir-1.2.11 hack_night/exercise/prob-1.rb
asir-1.2.10 hack_night/exercise/prob-1.rb
asir-1.2.9 hack_night/exercise/prob-1.rb
asir-1.2.8 hack_night/exercise/prob-1.rb
asir-1.2.7 hack_night/exercise/prob-1.rb
asir-1.2.6 hack_night/exercise/prob-1.rb
asir-1.2.5 hack_night/exercise/prob-1.rb
asir-1.2.3 hack_night/exercise/prob-1.rb
asir-1.2.2 hack_night/exercise/prob-1.rb
asir-1.2.1 hack_night/exercise/prob-1.rb
asir-1.2.0 hack_night/exercise/prob-1.rb
asir-1.1.12 hack_night/exercise/prob-1.rb
asir-1.1.11 hack_night/exercise/prob-1.rb
asir-1.1.10 hack_night/exercise/prob-1.rb
asir-1.1.9 hack_night/exercise/prob-1.rb
asir-1.1.8 hack_night/exercise/prob-1.rb
asir-1.1.7 hack_night/exercise/prob-1.rb
asir-1.1.6 hack_night/exercise/prob-1.rb
asir-1.1.5 hack_night/exercise/prob-1.rb
asir-1.1.4 hack_night/exercise/prob-1.rb