mobj 1.8.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mobj.rb +7 -3
- metadata +1 -1
data/lib/mobj.rb
CHANGED
@@ -157,12 +157,12 @@ module Mobj
|
|
157
157
|
alias includes? include?
|
158
158
|
alias contains? include?
|
159
159
|
|
160
|
-
def
|
160
|
+
def msum(initial = 0.0, op = :+, &block)
|
161
161
|
map(&:to_f).inject(initial, block ? block : op)
|
162
162
|
end
|
163
163
|
|
164
|
-
def
|
165
|
-
|
164
|
+
def mavg(&block)
|
165
|
+
msum(&block) / size
|
166
166
|
end
|
167
167
|
|
168
168
|
def values() self end
|
@@ -375,6 +375,10 @@ module Mobj
|
|
375
375
|
end
|
376
376
|
end
|
377
377
|
|
378
|
+
class ::Symbol
|
379
|
+
def walk(obj) to_s.walk(obj) end
|
380
|
+
end
|
381
|
+
|
378
382
|
class ::String
|
379
383
|
|
380
384
|
def matches(regexp)
|