glib 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/glib.rb +17 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df17ec4319b79068089c8564450d18f83e3f6f88
|
4
|
+
data.tar.gz: 8475803b97041deeca9b58f1b8c946385040bfbd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae803033c38ea622e8acfa03e1a0f322b74304f26654d754722a6adff30c4e57b402d733405f2c0cf2f70365706d20121d81dda6841d2c84e07c3eb08135d5c7
|
7
|
+
data.tar.gz: 336bca04db457902b113c28ba73277fa7807bf959da9ab3bc01e2e0de4334a4cbfed9c2b4e7bd56a53352ce5b54b5021d93cdc162a3a4729520c89cf23a8137c
|
data/lib/glib.rb
CHANGED
@@ -74,6 +74,15 @@ module Glib
|
|
74
74
|
puts ""
|
75
75
|
end
|
76
76
|
end
|
77
|
+
|
78
|
+
def self.uniform(array)
|
79
|
+
if not array.kind_of?(Array) then raise TypeError end
|
80
|
+
tot = array.length
|
81
|
+
for i in 1..array.length - 1
|
82
|
+
if array[i] == array[0] then tot-=1 end
|
83
|
+
end
|
84
|
+
return tot == 0
|
85
|
+
end
|
77
86
|
end
|
78
87
|
|
79
88
|
class Array
|
@@ -126,4 +135,12 @@ class Array
|
|
126
135
|
end
|
127
136
|
return greatest_index
|
128
137
|
end
|
138
|
+
|
139
|
+
def uniform()
|
140
|
+
tot = self.length
|
141
|
+
for i in 1..self.length - 1
|
142
|
+
if self[i] == self[0] then tot-=1 end
|
143
|
+
end
|
144
|
+
return tot == 0
|
145
|
+
end
|
129
146
|
end
|