Class: ArrayOrSingleElementEmpty

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/ontomde-core/meta.rb

Overview

Singleton of an empty ArrayOrSingleElement Note:

This object is used for performance enhancement.

Instance Method Summary collapse

Instance Method Details

#+(array) ⇒ Object

returns array



76
77
78
# File 'lib/ontomde-core/meta.rb', line 76

def +(array)
  return array
end

#delete(elt) ⇒ Object



105
106
107
# File 'lib/ontomde-core/meta.rb', line 105

def delete(elt)
  return nil
end

#eachObject

Iterator (does nothing)



65
66
# File 'lib/ontomde-core/meta.rb', line 65

def each
end

#empty?Boolean

return true

Returns:

  • (Boolean)


96
97
98
# File 'lib/ontomde-core/meta.rb', line 96

def empty?
  return true
end

#include?(elt) ⇒ Boolean

returns false

Returns:

  • (Boolean)


101
102
103
# File 'lib/ontomde-core/meta.rb', line 101

def include?(elt)
  return false
end

#isFalse?Boolean

returns !isTrue?

Returns:

  • (Boolean)


81
82
83
# File 'lib/ontomde-core/meta.rb', line 81

def isFalse?
  return !isTrue?
end

#isTrue?Boolean

returns false

Returns:

  • (Boolean)


86
87
88
# File 'lib/ontomde-core/meta.rb', line 86

def isTrue?
  return false
end

#lengthObject

Size of an empty Array (always 0)



60
61
62
# File 'lib/ontomde-core/meta.rb', line 60

def length
  0
end

#selectObject

returns self as



69
70
71
72
73
# File 'lib/ontomde-core/meta.rb', line 69

def select
  # quelque-soit le critere
  # de selection le retour est tout aussi vide
  return self;
end

#sizeObject

Size of an empty Array (always 0)



55
56
57
# File 'lib/ontomde-core/meta.rb', line 55

def size
  0
end

#sort(&block) ⇒ Object



109
110
111
# File 'lib/ontomde-core/meta.rb', line 109

def sort(&block)
  return self
end

#to_sObject

returns “”



91
92
93
# File 'lib/ontomde-core/meta.rb', line 91

def to_s
  return ''
end