cirro-ruby-client 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/cirro_io/client.rb +0 -5
- data/lib/cirro_io/client/version.rb +1 -1
- metadata +2 -4
- data/lib/cirro_io/base_association.rb +0 -33
- data/lib/cirro_io/has_one.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af3baedbf5539e9ad9f959866058793297fa577636b8b1d0668546feab80f4f5
|
4
|
+
data.tar.gz: 2a9fd6c37c1cb04385bf45fa20dd747909d92d472264d993221e31d7f1627b70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be7b514feca8a7afab9a31d99dd52a31ae837cb0586965673874472ac04d025d4ee8212eaedac8032863f80d59415c1a065fd262230804a33325092c9394fa23
|
7
|
+
data.tar.gz: a7a56b0ff10355836c1abe9ba293921052011b62eb2f1ff7ba302e68fa212e5eea5a8b5599fd226383d4100243fe2d0aab601d7636763883b5639487321d7638
|
data/Gemfile.lock
CHANGED
data/lib/cirro_io/client.rb
CHANGED
@@ -1,10 +1,5 @@
|
|
1
1
|
require 'json_api_client'
|
2
2
|
|
3
|
-
# temporary monkey patch code to fix gem bug
|
4
|
-
require 'cirro_io/has_one'
|
5
|
-
require 'cirro_io/base_association'
|
6
|
-
# temporary monkey patch code to fix gem bug
|
7
|
-
|
8
3
|
require 'cirro_io/client/version'
|
9
4
|
require 'cirro_io/client/configuration'
|
10
5
|
require 'cirro_io/client/response_debugging_middleware'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cirro-ruby-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cirro Dev Team
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-12-
|
11
|
+
date: 2020-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jwt
|
@@ -74,7 +74,6 @@ files:
|
|
74
74
|
- bin/console
|
75
75
|
- bin/setup
|
76
76
|
- cirro-ruby-client.gemspec
|
77
|
-
- lib/cirro_io/base_association.rb
|
78
77
|
- lib/cirro_io/client.rb
|
79
78
|
- lib/cirro_io/client/app_user.rb
|
80
79
|
- lib/cirro_io/client/app_worker.rb
|
@@ -89,7 +88,6 @@ files:
|
|
89
88
|
- lib/cirro_io/client/response_debugging_middleware.rb
|
90
89
|
- lib/cirro_io/client/version.rb
|
91
90
|
- lib/cirro_io/client/worker_invitation_filter.rb
|
92
|
-
- lib/cirro_io/has_one.rb
|
93
91
|
homepage: https://cirro.io/api-docs/v1#cirro-api-documentation
|
94
92
|
licenses:
|
95
93
|
- MIT
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module JsonApiClient
|
2
|
-
module Associations
|
3
|
-
class BaseAssociation
|
4
|
-
attr_reader :attr_name, :klass, :options
|
5
|
-
def initialize(attr_name, klass, options = {})
|
6
|
-
@attr_name = attr_name
|
7
|
-
@klass = klass
|
8
|
-
@options = options
|
9
|
-
end
|
10
|
-
|
11
|
-
def association_class
|
12
|
-
@association_class ||= Utils.compute_type(klass, options.fetch(:class_name) do
|
13
|
-
attr_name.to_s.classify
|
14
|
-
end)
|
15
|
-
end
|
16
|
-
|
17
|
-
def data(url)
|
18
|
-
from_result_set(association_class.requestor.linked(url))
|
19
|
-
end
|
20
|
-
|
21
|
-
def from_result_set(result_set)
|
22
|
-
result_set.to_a
|
23
|
-
end
|
24
|
-
|
25
|
-
def load_records(data)
|
26
|
-
data.map do |d|
|
27
|
-
record_class = Utils.compute_type(klass, klass.key_formatter.unformat(d['type']).classify)
|
28
|
-
record_class.load id: d['id']
|
29
|
-
end
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
data/lib/cirro_io/has_one.rb
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
module JsonApiClient
|
2
|
-
module Associations
|
3
|
-
module HasOne
|
4
|
-
class Association < BaseAssociation
|
5
|
-
def from_result_set(result_set)
|
6
|
-
result_set.first
|
7
|
-
end
|
8
|
-
|
9
|
-
def load_records(data)
|
10
|
-
record_class = Utils.compute_type(klass, klass.key_formatter.unformat(data['type']).classify)
|
11
|
-
record_class.load id: data['id']
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|