Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/graphr/base_extensions.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#delete_at_indices(indices = []) ⇒ Object
8 9 10 11 12 |
# File 'lib/graphr/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_uniq ⇒ Object
2 3 4 5 6 |
# File 'lib/graphr/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 |