remote-resource 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/remote_resource/attribute_method_attacher.rb +15 -12
- data/lib/remote_resource/base.rb +1 -1
- data/lib/remote_resource/version.rb +1 -1
- 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: f0f1518dc5e7e354ac2174ec9e71c4b4b5470266
|
4
|
+
data.tar.gz: 532431786c38ad80fb8e9e0a640a13846cef4686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78a8e415f174829d7c4e8069d77ad4765e3f172982411716a717ebc890a953fdbfe77a897dd5d1d4544c5308416fc75988aa7646971c2001f1644634d5fd143f
|
7
|
+
data.tar.gz: 5205f4efcf65a81ae97820be25a2ea71de7ff28a11091f79d70b963676e7d96da2db3be0ece6c3fa18edbe00bb896e710205dcb6e2604ee6f5899b5c17f0ff7c
|
@@ -54,21 +54,24 @@ module RemoteResource
|
|
54
54
|
# Internal: Returns a module with the base_classes' attributes defined as
|
55
55
|
# getter and setter methods.
|
56
56
|
def make_attribute_methods_module(path_to_attrs)
|
57
|
-
attribute_methods_module = AttributeMethods.new
|
57
|
+
attribute_methods_module = AttributeMethods.new { extend Mutex_m }
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
#{
|
65
|
-
|
59
|
+
attribute_methods_module.synchronize do
|
60
|
+
@base_class.attributes.keys.each do |attributes_method|
|
61
|
+
method_name = @options[:attributes_map][attributes_method]
|
62
|
+
method_name = "#{@options[:prefix]}_#{method_name}" if @options[:prefix]
|
63
|
+
attribute_methods_module.module_eval <<-RUBY, __FILE__, __LINE__ + 1
|
64
|
+
def #{method_name}
|
65
|
+
#{path_to_attrs}.get_attribute(:#{attributes_method})
|
66
|
+
end
|
66
67
|
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
68
|
+
def #{method_name}=(other)
|
69
|
+
fail ApiReadOnlyMethod.new('#{method_name}')
|
70
|
+
end
|
71
|
+
RUBY
|
72
|
+
end
|
71
73
|
end
|
74
|
+
attribute_methods_module.freeze
|
72
75
|
attribute_methods_module
|
73
76
|
end
|
74
77
|
|
data/lib/remote_resource/base.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: remote-resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Ewald
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|