Sha256: 79deb923ad62e24fc86515682016ef2af512a8323a7d972f52f7fecec5f44e48

Contents?: true

Size: 415 Bytes

Versions: 1

Compression:

Stored size: 415 Bytes

Contents

class Array
	def extract_options!
		if Hash === last then pop else {} end
	end
	def extract_options
		if Hash === last then last else {} end
	end

  def options
    if Hash === last
      self[-1] = AngryHash.__convert(last)
    else
      opts = AngryHash.new
      push opts
      opts
    end
  end

  def norm
    n = flatten
    n.compact!
    n
  end

  def norm!
    flatten!
    compact!
    self
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
angry_mob-0.1.0 lib/angry_mob/extend/array.rb