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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0615325b89bdbae524b7e54dc0360774ba453e55
4
- data.tar.gz: f9441fa6d760b8f0f4e49e038498cdc0b249ffb8
3
+ metadata.gz: f0f1518dc5e7e354ac2174ec9e71c4b4b5470266
4
+ data.tar.gz: 532431786c38ad80fb8e9e0a640a13846cef4686
5
5
  SHA512:
6
- metadata.gz: 5b73cc3191733078a6589fdda37bf1c0e45d2eb2fcd13e990f53c66ace41860dcf7a001fa078e4e70031503633c5adf9ae1a49bab721192964a3c55459820ec0
7
- data.tar.gz: 3b8e1950c93ea03a50b95d00e0a4f75ef3faf5f2528fdfc3db55b3a87878f2169306619f011709a165bed7ada0dca83a009d7e248f0dc83a8c1312d592558bc7
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
- @base_class.attributes.keys.each do |attributes_method|
60
- method_name = @options[:attributes_map][attributes_method]
61
- method_name = "#{@options[:prefix]}_#{method_name}" if @options[:prefix]
62
- attribute_methods_module.module_eval <<-RUBY, __FILE__, __LINE__ + 1
63
- def #{method_name}
64
- #{path_to_attrs}.get_attribute(:#{attributes_method})
65
- end
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
- def #{method_name}=(other)
68
- fail ApiReadOnlyMethod.new('#{method_name}')
69
- end
70
- RUBY
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
 
@@ -16,7 +16,7 @@ module RemoteResource
16
16
  def initialize(**args)
17
17
  @scope = args
18
18
  create_attributes(self)
19
- AttributeMethodAttacher.new(self.class).attach_to(self.class)
19
+ AttributeMethodAttacher.new(self.class).attach_to(self.singleton_class)
20
20
  end
21
21
 
22
22
  def client
@@ -1,3 +1,3 @@
1
1
  module RemoteResource
2
- VERSION = '0.1.1'
2
+ VERSION = '0.1.2'
3
3
  end
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.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-04-30 00:00:00.000000000 Z
11
+ date: 2016-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport