ims-lti 2.0.0.beta.25 → 2.0.0.beta.26

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: e7be661227a40bbc075f590754434ee998839ca4
4
- data.tar.gz: b24c28383d110639a7c364c7f861511db14e37bc
3
+ metadata.gz: bca1778908d5389e08878677bd4dd22e3f8abfa1
4
+ data.tar.gz: 643e69ddf5b40883445cb8178bf8e4307aacc33b
5
5
  SHA512:
6
- metadata.gz: 21ebec8d362ed86887dcbb6d460a3eea9e3521e336ed4ed75bf840126472393347ee67d4373270f32ac1df42ce384bd5eb261a9eb4effa2f98bfbf8993407565
7
- data.tar.gz: 1325212a19043fbeb5434ea2cfdfd3c92eb45ff44a505633f0d0e34b9be7c22ffbd99ebf98b195f9579ac49de340b7fa04539cfc026b4270e7db3eb288b3ad5a
6
+ metadata.gz: c48385ceb305eaa7aec1b7fe5883726abfb76fdf5a79735777c3e637c4cea472cd0fe08f7680221b497bdf8ca9271faecfe0a33ac9763fe1934ed3140bcfd0f9
7
+ data.tar.gz: d4e971786b7f498f2d50a9d2f5537b0478bbd3ff46a66ee22fba610822cbc4ed04bc9793e1b15729755a22c8dd27b00cc1896ea711b7df00c52f3fec4d4a6010
@@ -9,18 +9,24 @@ module IMS::LTI::Models
9
9
 
10
10
  def self.add_attributes(attribute, *attrs)
11
11
  attrs.unshift(attribute)
12
- self.attributes += attrs
13
- attr_accessor(attrs.shift, *attrs)
12
+ attrs -= self.attributes
13
+ if attrs.size > 0
14
+ self.attributes += attrs
15
+ attr_accessor(attrs.shift, *attrs)
16
+ end
14
17
  end
15
18
 
16
19
  def self.add_attribute(attribute, options = {})
17
20
  @serialization_options ||= {}
18
- options.each do |k, v|
21
+ keys = @serialization_options.keys + options.keys
22
+ keys.each do |k|
19
23
  @serialization_options[k] ||= {}
20
- @serialization_options[k][attribute] = v
24
+ options.has_key?(k) ? @serialization_options[k][attribute] = options[k] : @serialization_options[k].delete(attribute)
25
+ end
26
+ unless self.attributes.include? attribute
27
+ self.attributes += [attribute]
28
+ attr_accessor(attribute)
21
29
  end
22
- self.attributes += [attribute]
23
- attr_accessor(attribute)
24
30
  end
25
31
 
26
32
  def self.inherit_attributes(attrs)
@@ -188,7 +194,7 @@ module IMS::LTI::Models
188
194
  else
189
195
  opts = superclass.send(:serialization_options) || {}
190
196
  keys = opts.keys | @serialization_options.keys
191
- keys.each_with_object({}) {|k, h| h[k] = (opts[k] || {}).merge(@serialization_options[k] || {})}
197
+ keys.each_with_object({}) { |k, h| h[k] = (opts[k] || {}).merge(@serialization_options[k] || {}) }
192
198
  end
193
199
  end
194
200
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ims-lti
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.beta.25
4
+ version: 2.0.0.beta.26
5
5
  platform: ruby
6
6
  authors:
7
7
  - Instructure
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-29 00:00:00.000000000 Z
11
+ date: 2015-05-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simple_oauth