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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc4467ccd374f36f1a5793286254b9e0f5e0d7ca
4
- data.tar.gz: ecd7ed58e3635b2f9ca2494b6dfb69f32f772db8
3
+ metadata.gz: 37838db2bfccfd088505b989e6ad5e7e23d9d7d2
4
+ data.tar.gz: a41f4ce7ddf7175fedd855951af01361d03514ce
5
5
  SHA512:
6
- metadata.gz: d35ee19ff25eefb271ff21df71882056e8a989be0024ab261f63b094cc0943c9e68f0671e09bb6410fb668e0ceecb38f1b2a73492a097ad770b1821a3a72dc83
7
- data.tar.gz: f8dc378ee8c4e67a9ae4bfb80c4a30db378d65af261e00a96cfdb20006cdfebc1c865dd291a3a15bef2bf87d5a4d253011321d972fd3759c6534de193f1fee42
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 << self.class.get(doc_id)
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
@@ -1,3 +1,3 @@
1
1
  module RubyFFDB
2
- VERSION = [0, 1, 2].join('.')
2
+ VERSION = [0, 1, 3].join('.')
3
3
  end
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.2
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: 2015-06-12 00:00:00.000000000 Z
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.2.0
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: