nylas 4.2.1 → 4.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nylas/errors.rb +7 -0
- data/lib/nylas/model.rb +2 -0
- data/lib/nylas/model/attributable.rb +5 -1
- data/lib/nylas/registry.rb +3 -1
- data/lib/nylas/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96b809ac0220aafde8e93c2c96cabb0a183c11ca
|
4
|
+
data.tar.gz: 818166a918cf4e43d193e606c2449cebd051aa78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffbf5af184d03bd16d6967046a833c7793a28395017e4a175ad2b6a67f56661e9ef387fd6a5fe7b951b75b7186ff3dc531bab2964afda1b43f589279b8277abc
|
7
|
+
data.tar.gz: '019aab7a1b1d5784a5d7a498557fdba3c0af0df7e7b312e9fb96cfb9ef2214e7c3f341a2cfb82fad931a0b6afe1d26e66b66baba7ba04c1001cf4d742284ef3f'
|
data/lib/nylas/errors.rb
CHANGED
@@ -12,6 +12,13 @@ module Nylas
|
|
12
12
|
class ModelNotUpdatableError < ModelActionError; end
|
13
13
|
class ModelNotDestroyableError < ModelActionError; end
|
14
14
|
|
15
|
+
# Raised when attempting to set a field that is not on a model with mass assignment
|
16
|
+
class ModelMissingFieldError < ModelActionError
|
17
|
+
def initialize(field, model)
|
18
|
+
super("#{field} is not a valid attribute for #{model.class.name}")
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
15
22
|
# Indicates that a given method needs an access token to work.
|
16
23
|
class NoAuthToken < Error
|
17
24
|
def initialize(method_name)
|
data/lib/nylas/model.rb
CHANGED
@@ -8,7 +8,11 @@ module Nylas
|
|
8
8
|
|
9
9
|
def initialize(**initial_data)
|
10
10
|
initial_data.each do |attribute_name, value|
|
11
|
-
|
11
|
+
if self.class.attribute_definitions.key?(attribute_name)
|
12
|
+
send(:"#{attribute_name}=", value)
|
13
|
+
else
|
14
|
+
Logging.logger.warn("#{attribute_name} is not defined as an attribute on #{self.class.name}")
|
15
|
+
end
|
12
16
|
end
|
13
17
|
end
|
14
18
|
|
data/lib/nylas/registry.rb
CHANGED
@@ -5,14 +5,16 @@ module Nylas
|
|
5
5
|
# Used to indicate an attempt to retrieve something not yet registered in a registry
|
6
6
|
# Includes the list of keys in the registry for debug purposes.
|
7
7
|
class MissingKeyError < Error
|
8
|
+
attr_accessor :key
|
8
9
|
def initialize(key, keys)
|
9
10
|
super("key #{key} not in #{keys}")
|
11
|
+
self.key = key
|
10
12
|
end
|
11
13
|
end
|
12
14
|
attr_accessor :registry_data
|
13
15
|
|
14
16
|
extend Forwardable
|
15
|
-
def_delegators :registry_data, :keys, :each, :reduce
|
17
|
+
def_delegators :registry_data, :keys, :each, :reduce, :key?
|
16
18
|
|
17
19
|
def initialize(initial_data = {})
|
18
20
|
self.registry_data = initial_data.each.each_with_object({}) do |(key, value), registry|
|
data/lib/nylas/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nylas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.2.
|
4
|
+
version: 4.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nylas, Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -320,7 +320,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
320
320
|
version: '0'
|
321
321
|
requirements: []
|
322
322
|
rubyforge_project:
|
323
|
-
rubygems_version: 2.
|
323
|
+
rubygems_version: 2.6.13
|
324
324
|
signing_key:
|
325
325
|
specification_version: 4
|
326
326
|
summary: Gem for interacting with the Nylas API
|