Sha256: 4e5ae2a287e95248c3e089d6a5d59deb118aea4140c1bde607ad60bc51988be6

Contents?: true

Size: 473 Bytes

Versions: 77

Compression:

Stored size: 473 Bytes

Contents

## Advanced

It is typical to call [#to_enum](http://ruby-doc.org/core-2.3.1/Object.html#method-i-to_enum) when defining methods for a generic Enumerable, in case no block is passed.

Here is an additional test you could add:

```ruby
def test_accumulate_when_block_is_deferred
  skip
  accumulate_enumerator = [1, 2, 3].accumulate
  accumulated_result = accumulate_enumerator.each do |number|
    number * number
  end
  assert_equal [1, 4, 9], accumulated_result
end
```

Version data entries

77 entries across 77 versions & 1 rubygems

Version Path
trackler-2.2.1.180 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.179 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.178 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.177 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.176 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.175 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.174 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.173 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.172 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.171 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.170 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.169 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.167 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.166 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.165 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.164 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.163 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.162 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.161 tracks/ruby/exercises/accumulate/.meta/hints.md
trackler-2.2.1.160 tracks/ruby/exercises/accumulate/.meta/hints.md