Sha256: c91c68960591b11756b420d7fcbeba147dac6b36f4dca633837d88eaa8e14c25

Contents?: true

Size: 369 Bytes

Versions: 43

Compression:

Stored size: 369 Bytes

Contents

class Array
  def insert_last(element)
    self + [element]
  end

  def single
    first if single?
  end

  def single!
    raise 'There is more than one element' unless single?
    first
  end

  def single?
    size == 1
  end

  def multiple?
    size > 1
  end

  def randomize_with(randomizer, seed)
    map { |it| it.randomize_with randomizer, seed }
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
mumuki-domain-9.23.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.22.1 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.22.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.21.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.20.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.19.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.18.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.17.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.16.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.15.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.14.1 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.14.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.13.1 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.13.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.12.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.11.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.10.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.9.0 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.8.1 lib/mumuki/domain/extensions/array.rb
mumuki-domain-9.8.0 lib/mumuki/domain/extensions/array.rb