ncore 2.1.2 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,10 +38,18 @@ module NCore
38
38
  end
39
39
  end
40
40
 
41
+ def factory(parsed, api_creds)
42
+ if key = (parsed[:data] || parsed)[:object]
43
+ discover_class(key, self).new(parsed, api_creds)
44
+ else
45
+ new(parsed, api_creds)
46
+ end
47
+ end
48
+
41
49
 
42
50
  private
43
51
 
44
- def discover_class(key, default_klass=parent::GenericObject)
52
+ def discover_class(key, default_klass=module_parent::GenericObject)
45
53
  klass_name = key.to_s.camelize.singularize
46
54
  begin
47
55
  "#{module_name}::#{klass_name}".constantize
@@ -54,7 +62,7 @@ module NCore
54
62
 
55
63
 
56
64
  def inspect
57
- "#<#{self.class}:0x#{self.object_id.to_s(16)}> id: #{id.inspect}, attribs: #{@attribs.except(:id).inspect}, metadata: #{metadata.inspect}"
65
+ "#<#{self.class}:0x#{'%016x'%self.object_id} id: #{id.inspect}, attribs: #{@attribs.except(:id).inspect}, metadata: #{metadata.inspect}>"
58
66
  end
59
67
 
60
68
  end
@@ -1,3 +1,3 @@
1
1
  module NCore
2
- VERSION = '2.1.2'
2
+ VERSION = '3.1.0'
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency 'activesupport', '>= 3.2', '< 6'
21
+ spec.add_dependency 'activemodel', '>= 4.2', '< 6.1'
22
22
  spec.add_dependency 'excon', '~> 0.32'
23
23
 
24
24
  spec.add_development_dependency "bundler", "~> 1.3"
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ncore
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Notioneer Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-16 00:00:00.000000000 Z
11
+ date: 2020-06-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: activesupport
14
+ name: activemodel
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3.2'
19
+ version: '4.2'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6'
22
+ version: '6.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '3.2'
29
+ version: '4.2'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6'
32
+ version: '6.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: excon
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -97,6 +97,7 @@ files:
97
97
  - lib/ncore/base.rb
98
98
  - lib/ncore/builder.rb
99
99
  - lib/ncore/client.rb
100
+ - lib/ncore/client_cache.rb
100
101
  - lib/ncore/collection.rb
101
102
  - lib/ncore/configuration.rb
102
103
  - lib/ncore/exceptions.rb
@@ -112,9 +113,11 @@ files:
112
113
  - lib/ncore/methods/find.rb
113
114
  - lib/ncore/methods/find_single.rb
114
115
  - lib/ncore/methods/update.rb
116
+ - lib/ncore/methods/update_bulk.rb
115
117
  - lib/ncore/rails/action_controller.rb
116
118
  - lib/ncore/rails/active_model.rb
117
119
  - lib/ncore/rails/log_subscriber.rb
120
+ - lib/ncore/rails/module_fix.rb
118
121
  - lib/ncore/singleton_base.rb
119
122
  - lib/ncore/ssl/ca-certificates.crt
120
123
  - lib/ncore/util.rb
@@ -139,8 +142,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
142
  - !ruby/object:Gem::Version
140
143
  version: '0'
141
144
  requirements: []
142
- rubyforge_project:
143
- rubygems_version: 2.7.6
145
+ rubygems_version: 3.0.8
144
146
  signing_key:
145
147
  specification_version: 4
146
148
  summary: NCore - Gem for building REST API clients