Class: Array

Inherits:
Object show all
Defined in:
lib/other.rb

Direct Known Subclasses

OrientSupport::Array

Instance Method Summary collapse

Instance Method Details

#analyseObject

used to enable def abc *key where key is a Range, an comma separated List or an item aimed to support #compose_where


23
24
25
26
27
28
29
30
31
# File 'lib/other.rb', line 23

def analyse # :nodoc:
  if first.is_a?(Range) 
   first
  elsif size ==1
    first
  else
    self
  end
end

#from_orientObject


12
13
14
# File 'lib/other.rb', line 12

def from_orient
  map &:from_orient
end

#orient_flattenObject


33
34
35
36
37
38
# File 'lib/other.rb', line 33

def orient_flatten
	while( first.is_a?(Array) )
		self.flatten!(1)
	end
	self
end

#to_humanObject


16
17
18
# File 'lib/other.rb', line 16

def to_human
	map &:to_human
end

#to_orObject


8
9
10
# File 'lib/other.rb', line 8

def to_or
  "["+ map( &:to_or).join(', ')+"]"
end

#to_orientObject

Class extentions to manage to_orient and from_orient


4
5
6
# File 'lib/other.rb', line 4

def to_orient
  map( &:to_orient) # .join(',')
end