Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/fsm-0.0.0/graph/base_extensions.rb

Direct Known Subclasses

DefaultInitArray

Instance Method Summary collapse

Instance Method Details

#delete_at_indices(indices = []) ⇒ Object


8
9
10
11
12
# File 'lib/fsm-0.0.0/graph/base_extensions.rb', line 8

def delete_at_indices(indices = [])
  not_deleted = Array.new
  self.each_with_index {|e,i| not_deleted.push(e) if !indices.include?(i)} 
  not_deleted
end

#equality_uniqObject


2
3
4
5
6
# File 'lib/fsm-0.0.0/graph/base_extensions.rb', line 2

def equality_uniq
  uniq_elements = []
  self.each {|e| uniq_elements.push(e) unless uniq_elements.index(e)}
  uniq_elements
end