sessionm-cassandra_object 4.0.8 → 4.0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b32eb7a894405a4399b87dc00f76cfe876143cf2
4
- data.tar.gz: 82653142b08649bb6b85d2560555078eee34f20b
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YWE4YjNlNjM2NWFjMDgxNWRjOTVmZDJlNmRjZDIwZGI5ZGFmMjMyYg==
5
+ data.tar.gz: !binary |-
6
+ MzA5ODFmM2EyM2Y3NjY2YTgwMjJlMDJlM2I2MTc2NmE0MGE4NzA0YQ==
5
7
  SHA512:
6
- metadata.gz: 4f63f068d578ad66380bff52058bbf9708309f2a6bc22de0570e8e2fd19084ce770a838e43997f564a8e41d81de419e96c7996b95d63af001a8a18a10a1bf0f9
7
- data.tar.gz: 487cd92c5e692463e5d387de7d49f7f2caaa21b3c6da2dd684f88f0d443540ce817708c2f63b5159e5fa1d2e669459667bc993fdbaf3efc24c466dac64ecc3e8
8
+ metadata.gz: !binary |-
9
+ M2I4ZWFiN2RlMWNkMThlOGEyNTIwMjYwMjdmOTc1MTgyNTUyMzIxY2U0OGIw
10
+ YTAwZjUyZWM0YTQ2ODFhOWI2NThlODFkYTI3MGQ4ZmYxNTk5MzU5M2Q2YmNk
11
+ ZDE5ODEwYzE2Y2IwN2I2MjViOGFhMTdhNmZmMzkxZDA2ZjMxNGY=
12
+ data.tar.gz: !binary |-
13
+ ZmNlOWE0MTJlNjdhZDMzMmRjOTYyMzJmYmQyMzM2MzFmMzdhNjI0N2NhNTJi
14
+ OTVkN2I0YjVlNmQzMmI2MDE4OWQxOGFjZjJmZjk4Y2E4MjUxZjE1Mjc5MmQ0
15
+ NmRkMWQ4NWZlYzRmYTAwN2ZmM2NhNjBiNDJiYmU1ZTQ4NDZiNDU=
@@ -108,6 +108,23 @@ module CassandraObject
108
108
  end
109
109
  end
110
110
 
111
+ def get_columns(column_family, key, columns, opts)
112
+ async = opts.try(:[], :async)
113
+
114
+ key = "textAsBlob('#{key}')"
115
+
116
+ name_fields = columns.map { |c| "'#{c}'" }.join(', ')
117
+
118
+ query = "SELECT #{NAME_FIELD}, #{VALUE_FIELD} FROM \"#{column_family}\" WHERE #{NAME_FIELD} IN(#{name_fields}) AND #{KEY_FIELD} = #{key}"
119
+
120
+ result = async ? self.execute_async(query, execute_options(opts)) : self.execute(query, execute_options(opts))
121
+ return result if async
122
+
123
+ result
124
+ .inject({}) { |hsh, row| hsh[row[NAME_FIELD]] = row[VALUE_FIELD]; hsh }
125
+ .slice(*columns.map(&:to_s))
126
+ end
127
+
111
128
  def add(column_family, key, by, fields, opts=nil)
112
129
  async = opts.try(:[], :async)
113
130
  fields = [fields] unless fields.is_a?(Array)
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'sessionm-cassandra_object'
5
- s.version = '4.0.8'
5
+ s.version = '4.0.9'
6
6
  s.description = 'Cassandra ActiveModel'
7
7
  s.summary = 'Cassandra ActiveModel'
8
8
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sessionm-cassandra_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.8
4
+ version: 4.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Koziarski
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-07-06 00:00:00.000000000 Z
13
+ date: 2015-12-22 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Cassandra ActiveModel
16
16
  email: doug@sessionm.com
@@ -19,9 +19,9 @@ extensions: []
19
19
  extra_rdoc_files:
20
20
  - README.markdown
21
21
  files:
22
- - ".gitignore"
23
- - ".ruby-gemset"
24
- - ".ruby-version"
22
+ - .gitignore
23
+ - .ruby-gemset
24
+ - .ruby-version
25
25
  - CHANGELOG
26
26
  - Gemfile
27
27
  - Gemfile.lock
@@ -142,12 +142,12 @@ require_paths:
142
142
  - lib
143
143
  required_ruby_version: !ruby/object:Gem::Requirement
144
144
  requirements:
145
- - - ">="
145
+ - - ! '>='
146
146
  - !ruby/object:Gem::Version
147
147
  version: '0'
148
148
  required_rubygems_version: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ">="
150
+ - - ! '>='
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  requirements: []