Class: SDC::SpecialContainer

Inherits:
Object
  • Object
show all
Defined in:
lib/core/SpecialContainer.rb

Instance Method Summary collapse

Constructor Details

#initializeSpecialContainer

Returns a new instance of SpecialContainer.



10
11
12
# File 'lib/core/SpecialContainer.rb', line 10

def initialize
	@values = []	
end

Instance Method Details

#add(element, index = nil) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/core/SpecialContainer.rb', line 14

def add(element, index = nil)
	if index then
		@values[index] = element 
	else
		@values.push(element)
	end

	return @values.size
end

#get(index) ⇒ Object



28
29
30
# File 'lib/core/SpecialContainer.rb', line 28

def get(index)
	return @values[index]
end

#get_allObject



24
25
26
# File 'lib/core/SpecialContainer.rb', line 24

def get_all
	return @values
end

#sizeObject



32
33
34
# File 'lib/core/SpecialContainer.rb', line 32

def size
	return @values.size
end