rffdb 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rffdb/document_collection.rb +18 -3
- data/lib/rffdb/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37838db2bfccfd088505b989e6ad5e7e23d9d7d2
|
4
|
+
data.tar.gz: a41f4ce7ddf7175fedd855951af01361d03514ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f5a755761ebf31cc18fb208edcd607162a67b052bcbcd97a6e12ebd958fd57e016c5df9806c8b0b303fe9a3e1d6c40063583f4f8fd0dd025114e533ad886c8a
|
7
|
+
data.tar.gz: 6642ec484386203f3c1f7fad6aaef202b33bd1448a1be603ea4f340a830a09be5fb0808cd8db7ce97b0f947aa49eac123bf22b5e048a926a89747643d5288516
|
@@ -86,7 +86,7 @@ module RubyFFDB
|
|
86
86
|
new_keys += other.collect(&:id)
|
87
87
|
|
88
88
|
new_keys.sort.uniq.each do |doc_id|
|
89
|
-
new_list <<
|
89
|
+
new_list << @type.get(doc_id)
|
90
90
|
end
|
91
91
|
|
92
92
|
self.class.new(new_list, @type)
|
@@ -123,11 +123,11 @@ module RubyFFDB
|
|
123
123
|
# @param attribute [Symbol] the attribute to query
|
124
124
|
# @param value [Object] the value to compare against
|
125
125
|
# @param comparison_method [String,Symbol] the method to use for comparison
|
126
|
-
# - allowed options are "'==', '>', '>=', '<', '<=', and 'match'"
|
126
|
+
# - allowed options are "'==', '!=', '>', '>=', '<', '<=', and 'match'"
|
127
127
|
# @raise [Exceptions::InvalidWhereQuery] if not the right kind of comparison
|
128
128
|
# @return [DocumentCollection]
|
129
129
|
def where(attribute, value, comparison_method = '==')
|
130
|
-
valid_comparison_methods = [:'==', :'>', :'>=', :'<', :'<=', :match]
|
130
|
+
valid_comparison_methods = [:'==', :'!=', :'>', :'>=', :'<', :'<=', :match]
|
131
131
|
unless valid_comparison_methods.include?(comparison_method.to_sym)
|
132
132
|
fail Exceptions::InvalidWhereQuery
|
133
133
|
end
|
@@ -142,5 +142,20 @@ module RubyFFDB
|
|
142
142
|
@type
|
143
143
|
)
|
144
144
|
end
|
145
|
+
|
146
|
+
alias_method :and, :where
|
147
|
+
|
148
|
+
# Hacked together #or() method in the same spirit as #where().
|
149
|
+
# This method can be chained for multiple / more specific queries.
|
150
|
+
#
|
151
|
+
# @param attribute [Symbol] the attribute to query
|
152
|
+
# @param value [Object] the value to compare against
|
153
|
+
# @param comparison_method [String,Symbol] the method to use for comparison
|
154
|
+
# - allowed options are "'==', '!=', '>', '>=', '<', '<=', and 'match'"
|
155
|
+
# @raise [Exceptions::InvalidWhereQuery] if not the right kind of comparison
|
156
|
+
# @return [DocumentCollection]
|
157
|
+
def or(attribute, value, comparison_method = '==')
|
158
|
+
merge @type.where(attribute, value, comparison_method)
|
159
|
+
end
|
145
160
|
end
|
146
161
|
end
|
data/lib/rffdb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rffdb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Gnagy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -67,9 +67,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
67
|
version: '0'
|
68
68
|
requirements: []
|
69
69
|
rubyforge_project:
|
70
|
-
rubygems_version: 2.
|
70
|
+
rubygems_version: 2.4.8
|
71
71
|
signing_key:
|
72
72
|
specification_version: 4
|
73
73
|
summary: Ruby FlatFile DB
|
74
74
|
test_files: []
|
75
|
-
has_rdoc:
|