Sha256: a13559d39a3e5ac1dfa058c5635ed3f9436dfca91c21994c8939e5a0c75ba8ed

Contents?: true

Size: 147 Bytes

Versions: 5

Compression:

Stored size: 147 Bytes

Contents

class Array
  def singular?() size == 1 end
  def singular() singular?? first : nil end
  def singular!() singular or raise "not singular" end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
freighthopper-0.1.14 lib/freighthopper/array/singular.rb
freighthopper-0.1.13 lib/freighthopper/array/singular.rb
freighthopper-0.1.12 lib/freighthopper/array/singular.rb
freighthopper-0.1.11 lib/freighthopper/array/singular.rb
freighthopper-0.1.9 lib/freighthopper/array/singular.rb