nylas 4.2.3 → 4.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6ed66b02d6c9e35e4d3213f8f3742811cf122d25
4
- data.tar.gz: 186964f6e03fed40a415ab33ea29433e995b4aa4
3
+ metadata.gz: 4a61da1587b7ea34f4bf8b6fe98ed453f3557860
4
+ data.tar.gz: a9b33048fda409acecf5fa507aa3ee3fd15fb6f4
5
5
  SHA512:
6
- metadata.gz: 743c705fedb2b578a18e1342063104d00761f10c853525b3b9f0a4d76f1c9eddd0d116b56a34cd3e781c5befe85060ab3f90b7d0c298c4888df9a1d44d9ffe7b
7
- data.tar.gz: ad67cfc1140b6b1b6185f0ad7450f9895b95844ad3850916106528221f03d493c94dbc87fb4258402be3be1fedf4a0393e6b948768c10303199d82f569e347eb
6
+ metadata.gz: 1fbb5dfbeda1db33d13ee472846fc084a2d13e990d42aa99079bd3f649703511ba19ac0a00df06bb5fe47c74cc3d93b26cb46d1e546245e95842bb585c63a03f
7
+ data.tar.gz: ad9893411ecdeffa7e74cb6ca5fe99338000159503582ea05258d427236782c34694fe57d7aa8d205a641bdf83475d42c78ead049f4d6462ed984c0ef69d3aff
@@ -53,7 +53,7 @@ module Nylas
53
53
  end
54
54
 
55
55
  def reload
56
- attributes.merge(execute(method: :get, path: resource_path))
56
+ assign(execute(method: :get, path: resource_path))
57
57
  true
58
58
  end
59
59
 
@@ -136,8 +136,7 @@ module Nylas
136
136
  end
137
137
 
138
138
  def from_hash(data, api:)
139
- instance = new(**data)
140
- instance.api = api
139
+ instance = new(**data.merge(api: api))
141
140
  instance
142
141
  end
143
142
  end
@@ -7,8 +7,12 @@ module Nylas
7
7
  end
8
8
 
9
9
  def initialize(**initial_data)
10
- initial_data.each do |attribute_name, value|
11
- if self.class.attribute_definitions.key?(attribute_name)
10
+ assign(**initial_data)
11
+ end
12
+
13
+ protected def assign(**data)
14
+ data.each do |attribute_name, value|
15
+ if respond_to?(:"#{attribute_name}=")
12
16
  send(:"#{attribute_name}=", value)
13
17
  else
14
18
  Logging.logger.warn("#{attribute_name} is not defined as an attribute on #{self.class.name}")
@@ -1,3 +1,3 @@
1
1
  module Nylas
2
- VERSION = "4.2.3".freeze
2
+ VERSION = "4.2.4".freeze
3
3
  end
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.3
4
+ version: 4.2.4
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-07-13 00:00:00.000000000 Z
11
+ date: 2018-08-07 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.6.13
323
+ rubygems_version: 2.5.2.3
324
324
  signing_key:
325
325
  specification_version: 4
326
326
  summary: Gem for interacting with the Nylas API