occams-record 0.4.1 → 0.5.0
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/occams-record/query.rb +16 -0
- data/lib/occams-record/version.rb +1 -1
- 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: 7363e28e8ba4c2d1fbbec8ea67e9cdbcfc9b1645
|
4
|
+
data.tar.gz: 5878b150352c20bcce6e88c831d361402c04e3ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b9f69f663aed9de81807318203acc190930c29eff65e0c8dd82a6d3740f85cd6716ac0a8c588b67a082c5b93f6467fa76513be582c20f0f730b33410aeb4700
|
7
|
+
data.tar.gz: b041632604fddd68ee0249e235b92973da897a4a1aefa7f312b18b58a856f2471c0d29506421aa0fbbce30fe8c5b71d99d443024c64f68304672baab74e43be9
|
data/lib/occams-record/query.rb
CHANGED
@@ -100,5 +100,21 @@ module OccamsRecord
|
|
100
100
|
|
101
101
|
rows
|
102
102
|
end
|
103
|
+
|
104
|
+
alias_method :to_a, :run
|
105
|
+
|
106
|
+
#
|
107
|
+
# If you pass a block, each result row will be yielded to it. If you don't,
|
108
|
+
# an Enumerable will be returned.
|
109
|
+
#
|
110
|
+
# @return Enumerable
|
111
|
+
#
|
112
|
+
def each
|
113
|
+
if block_given?
|
114
|
+
to_a.each { |row| yield row }
|
115
|
+
else
|
116
|
+
to_a.each
|
117
|
+
end
|
118
|
+
end
|
103
119
|
end
|
104
120
|
end
|