materialize 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/materialize/repo.rb +3 -1
- data/lib/materialize/response.rb +20 -0
- data/lib/materialize/version.rb +1 -1
- data/lib/materialize.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2d3c35112a52f54064b134de43a682a32e6e3b6b
|
4
|
+
data.tar.gz: 4316b68d51a8e4f41555ae602fe81f87d83d2493
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5742f7c7a8a3b6127b9a7540c94f781063213481244c6dbe833ca4a27b9bc8e73efbe9e3c8af6388f8ed8bb961620e2d2d048be91fcf5fdd0394bc36e4d5b610
|
7
|
+
data.tar.gz: e263942bc017d88bdcc6fd197c3b43930aadcd2596a6609b588c9f6199a25ccf1908d40db7749e4529f565f42a46712554fb7d383ffab38e8fb6d9dbfc20a370
|
data/lib/materialize/repo.rb
CHANGED
@@ -15,7 +15,9 @@ module Materialize
|
|
15
15
|
data, builder_class = process(data_source_class, query, args_to_pass)
|
16
16
|
options.delete(:args)
|
17
17
|
|
18
|
-
if data.is_a?(
|
18
|
+
if data.is_a?(Hash) and !data['message'].nil?
|
19
|
+
Response.new data
|
20
|
+
elsif data.is_a?(Array)
|
19
21
|
builder_class.build_all(data, self, options)
|
20
22
|
else
|
21
23
|
builder_class.build(data, self, options)
|
@@ -0,0 +1,20 @@
|
|
1
|
+
class Response
|
2
|
+
|
3
|
+
attr_reader :message, :status, :options
|
4
|
+
|
5
|
+
def initialize(options)
|
6
|
+
@message = options['message']
|
7
|
+
@status = options['status'].to_sym
|
8
|
+
@options = options
|
9
|
+
end
|
10
|
+
|
11
|
+
def ok?
|
12
|
+
status == :ok
|
13
|
+
end
|
14
|
+
|
15
|
+
# This is used to look up ids -> e.g. patient_id, phase_id, etc.
|
16
|
+
def method_missing(message)
|
17
|
+
options.send(:[], message.to_s)
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
data/lib/materialize/version.rb
CHANGED
data/lib/materialize.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: materialize
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stephen Fiser
|
@@ -76,6 +76,7 @@ files:
|
|
76
76
|
- lib/materialize/concurrent.rb
|
77
77
|
- lib/materialize/entity.rb
|
78
78
|
- lib/materialize/repo.rb
|
79
|
+
- lib/materialize/response.rb
|
79
80
|
- lib/materialize/version.rb
|
80
81
|
- materialize.gemspec
|
81
82
|
homepage: http://bluebear.io
|