algebrick 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/algebrick.rb +20 -4
- 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: c59b78e81ddad7a8982de954309dba01ccc26db9
|
4
|
+
data.tar.gz: 94cbecbb1b1bd1f3ca682fa0707439b7afcba7fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aeff2d9b02f3f947f0019c9c915f37194a1c02bc4d20eef4f7365ad22c836c8b4158b10cfc0686f66e9a640bb0cb1dff0cc39c253328ee043926f6dfe9dc851e
|
7
|
+
data.tar.gz: d225e46f414574b28ff8719639d1ce193fe12e86935d27a9faef0bcaed2c3003ee2eebaf5eb336bdaf5f697d3f3ab8d24bd84df1e98c69d3f2d3161950b87453
|
data/README.md
CHANGED
data/lib/algebrick.rb
CHANGED
@@ -120,6 +120,18 @@ module Algebrick
|
|
120
120
|
def !
|
121
121
|
!to_m
|
122
122
|
end
|
123
|
+
|
124
|
+
def -(block)
|
125
|
+
to_m - block
|
126
|
+
end
|
127
|
+
|
128
|
+
def case(&block)
|
129
|
+
to_m.case &block
|
130
|
+
end
|
131
|
+
|
132
|
+
def >>(block)
|
133
|
+
to_m >> block
|
134
|
+
end
|
123
135
|
end
|
124
136
|
|
125
137
|
class Type < Module
|
@@ -374,7 +386,7 @@ module Algebrick
|
|
374
386
|
self[*fields.map { |value| field_from_hash value }]
|
375
387
|
when Hash
|
376
388
|
self[fields.inject({}) do |h, (name, value)|
|
377
|
-
raise ArgumentError unless @field_names.map(&:to_s).include? name
|
389
|
+
raise ArgumentError unless @field_names.map(&:to_s).include? name.to_s
|
378
390
|
h.update name.to_sym => field_from_hash(value)
|
379
391
|
end]
|
380
392
|
end
|
@@ -533,12 +545,16 @@ module Algebrick
|
|
533
545
|
return self, block
|
534
546
|
end
|
535
547
|
|
536
|
-
def
|
548
|
+
def -(block)
|
537
549
|
return self, block
|
538
550
|
end
|
539
551
|
|
540
|
-
alias_method
|
541
|
-
|
552
|
+
alias_method :>>, :-
|
553
|
+
|
554
|
+
def +(block)
|
555
|
+
warn 'a_matcher +-> {} is deprecated, it\'ll be removed in 0.2'
|
556
|
+
self - block
|
557
|
+
end
|
542
558
|
|
543
559
|
def ~
|
544
560
|
@assign = true
|