restly 0.0.1.alpha.22 → 0.0.1.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/restly/base/resource/specification/fields.rb +9 -5
- data/lib/restly/connection.rb +0 -1
- data/lib/restly/version.rb +1 -1
- data/lib/restly.rb +0 -1
- metadata +1 -1
@@ -11,12 +11,12 @@ class Restly::Base::Resource::Specification::Fields < Restly::Proxies::Base
|
|
11
11
|
|
12
12
|
def - field
|
13
13
|
@removed << field
|
14
|
-
|
14
|
+
replace(__getobj__.send __method__, field)
|
15
15
|
end
|
16
16
|
|
17
17
|
def + field
|
18
18
|
@added << field
|
19
|
-
|
19
|
+
replace(__getobj__.send __method__, field)
|
20
20
|
end
|
21
21
|
|
22
22
|
private
|
@@ -24,14 +24,18 @@ class Restly::Base::Resource::Specification::Fields < Restly::Proxies::Base
|
|
24
24
|
def method_missing(m, *args, &block)
|
25
25
|
reload_specification! if !super.present? || m == :inspect
|
26
26
|
if (value = super).is_a? self.class
|
27
|
-
|
28
|
-
duplicate.__setobj__ super
|
29
|
-
duplicate
|
27
|
+
replace(super)
|
30
28
|
else
|
31
29
|
value
|
32
30
|
end
|
33
31
|
end
|
34
32
|
|
33
|
+
def replace(object)
|
34
|
+
duplicate = self.dup
|
35
|
+
duplicate.__setobj__ object
|
36
|
+
duplicate
|
37
|
+
end
|
38
|
+
|
35
39
|
def reload_specification!
|
36
40
|
from_spec = spec[:attributes] || []
|
37
41
|
fields = (from_spec - @removed.to_a) + @added.to_a
|
data/lib/restly/connection.rb
CHANGED
data/lib/restly/version.rb
CHANGED
data/lib/restly.rb
CHANGED