Class: Array

Inherits:
Object show all
Defined in:
lib/angry_mob/extend/array.rb

Instance Method Summary collapse

Instance Method Details

#extract_optionsObject



5
6
7
# File 'lib/angry_mob/extend/array.rb', line 5

def extract_options
	if Hash === last then last else {} end
end

#extract_options!Object



2
3
4
# File 'lib/angry_mob/extend/array.rb', line 2

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

#normObject



19
20
21
22
23
# File 'lib/angry_mob/extend/array.rb', line 19

def norm
  n = flatten
  n.compact!
  n
end

#norm!Object



25
26
27
28
29
# File 'lib/angry_mob/extend/array.rb', line 25

def norm!
  flatten!
  compact!
  self
end

#optionsObject



9
10
11
12
13
14
15
16
17
# File 'lib/angry_mob/extend/array.rb', line 9

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