dicom 0.6.1 → 0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,36 +0,0 @@
1
- # This file contains extensions to the Ruby library which are used by Ruby DICOM.
2
-
3
- class Array
4
-
5
- # Searching all indices, or a subset of indices, in an array, and returning all indices
6
- # where the array's value equals the queried value.
7
- def all_indices(array, value)
8
- result = []
9
- self.each do |pos|
10
- result << pos if array[pos] == value
11
- end
12
- result
13
- end
14
-
15
- # Similar to method above, but this one returns the position of all strings that
16
- # contain the query string (exact match not required).
17
- def all_indices_partial_match(array, value)
18
- result = []
19
- self.each do |pos|
20
- result << pos if array[pos].include?(value)
21
- end
22
- result
23
- end
24
-
25
- end
26
-
27
- class String
28
-
29
- # Check if a given string appears to be a valid tag:
30
- def is_a_tag?
31
- result = false
32
- result = true if self.length == 9 and self[4..4] == ','
33
- result
34
- end
35
-
36
- end