ims-lti 2.0.0.beta.7 → 2.0.0.beta.8
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 +4 -4
- data/lib/ims/lti/models/localized_name.rb +1 -0
- data/lib/ims/lti/models/localized_text.rb +1 -0
- data/lib/ims/lti/models/lti_model.rb +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 470901be5d078035d8d652194c97082c60c5c5df
|
4
|
+
data.tar.gz: 41c6440032084cbc2f6b6fd5c84965e9b01474b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05ed9cd89b2b949cdc351ff79d26ebafaeda77df2d25b41c13ab5438a0a1d4775ebaed924379ad03cd091be8caa4e95960cf2a0e97c3dcd2393f2801ccb7ea74
|
7
|
+
data.tar.gz: e51238d0b05b1adfb8569ba79379546deedbadbdced899980fe413a3cbb4d0709104d73e403a3e495dbf84c3f10a32340bd736ef50796694fe80a12dbd1c2d6e
|
@@ -4,6 +4,7 @@ module IMS::LTI::Models
|
|
4
4
|
|
5
5
|
def initialize(attributes = {})
|
6
6
|
self.attributes = attributes
|
7
|
+
@ext_attributes = {}
|
7
8
|
end
|
8
9
|
|
9
10
|
def self.add_attributes(attribute, *attrs)
|
@@ -48,6 +49,8 @@ module IMS::LTI::Models
|
|
48
49
|
attrs.each do |k, v|
|
49
50
|
if self.class.attributes.include?(k.to_sym)
|
50
51
|
instance_variable_set("@#{k.to_s}", v)
|
52
|
+
elsif k.to_s =~ /^ext_/
|
53
|
+
@ext_attributes[k.to_sym] = v
|
51
54
|
else
|
52
55
|
warn("Unknown attribute '#{k}'")
|
53
56
|
end
|
@@ -61,6 +64,7 @@ module IMS::LTI::Models
|
|
61
64
|
val = attributes[attr.to_s]
|
62
65
|
json_hash[json_key(attr)] = val.as_json if val
|
63
66
|
end
|
67
|
+
json_hash = @ext_attributes.merge(json_hash)
|
64
68
|
json_hash.merge! to_json_conversions
|
65
69
|
json_hash.merge! to_json_keys
|
66
70
|
json_hash
|
@@ -79,6 +83,14 @@ module IMS::LTI::Models
|
|
79
83
|
end
|
80
84
|
end
|
81
85
|
|
86
|
+
def method_missing(meth, *args, &block)
|
87
|
+
if match = /^ext_([^=$]*)/.match(meth)
|
88
|
+
meth =~ /=$/ ? @ext_attributes[match.to_s.to_sym] = args[0] : @ext_attributes[match.to_s.to_sym]
|
89
|
+
else
|
90
|
+
super
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
82
94
|
private
|
83
95
|
|
84
96
|
def process_json_hash(hash)
|
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.
|
4
|
+
version: 2.0.0.beta.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Instructure
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: simple_oauth
|