almodovar 1.2.0 → 1.3.0

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: 67f09d80b367d815bf580995400fbaf0fb589174
4
- data.tar.gz: 19335b425e1d783257e891a09c9090b0c9ce287c
3
+ metadata.gz: aa3519d3c78f5c66978d18772d987dc01505a839
4
+ data.tar.gz: 40bfad663340cd2552b48e202ed53f672dab9fc0
5
5
  SHA512:
6
- metadata.gz: 0438de97daab360f3aade00a3e38aef463f20fd2499278a2a7dd4d5405020528dc8383f854384495bc71f35f676eea8f8eabf1c925475f80110dbc9c528da444
7
- data.tar.gz: eabfb732d421530d5566e0cbf6307d4b556d420d78c5b415db3d7791585ac51f4e41306d974d4654766f5930541beedfc075fb64adf6b635d3a92aea8d3aa1fe
6
+ metadata.gz: e7894e479c3e42d9c1c97b7a0ef98db7e7d803758a20f46777e8c61c412da42ba531cf2e35bd165da8612ae6e39283311643254b4c92fde188bd10968f64e39c
7
+ data.tar.gz: 562b4c16f53c7984cb8a3f52703747f022742f0600419656da83668dee1a9c081a4c1ee161f6e973c2becedb2cc01b8024c0b1a3ef86fbc74ca797ed41ff1e2a
@@ -4,53 +4,53 @@ module Almodovar
4
4
 
5
5
  undef_method :id if instance_methods.include?("id")
6
6
  undef_method :type if instance_methods.include?("type")
7
-
7
+
8
8
  delegate :inspect, :to => :get!
9
-
9
+
10
10
  def self.from_xml(xml, auth = nil)
11
11
  new(nil, auth, Nokogiri::XML.parse(xml).root)
12
12
  end
13
-
13
+
14
14
  def initialize(url, auth, xml = nil, options = {})
15
15
  @url = url
16
16
  @auth = auth
17
17
  @xml = xml
18
18
  @options = options
19
19
  end
20
-
20
+
21
21
  def method_missing(meth, *args, &blk)
22
22
  resource_object(meth).send(meth, *args, &blk)
23
23
  end
24
-
25
- def get!
26
- klass = xml['type'] == 'array' ? ResourceCollection : SingleResource
27
- @resource_object = klass.new(@url, @auth, @xml, @options)
28
- end
29
-
24
+
30
25
  def respond_to?(meth)
31
26
  super || resource_object(meth).respond_to?(meth)
32
27
  end
33
-
28
+
34
29
  private
35
-
30
+
31
+ def get!
32
+ klass = xml['type'] == 'array' ? ResourceCollection : SingleResource
33
+ @resource_object = klass.new(@url, @auth, @xml, @options)
34
+ end
35
+
36
36
  def collection_call?(meth, *args)
37
37
  ([].respond_to?(meth) && !["delete", "id", "[]"].include?(meth.to_s)) ||
38
38
  ResourceCollection.instance_methods(false).map(&:to_s).include?(meth.to_s) ||
39
39
  (meth.to_s == "[]" && args.size == 1 && args.first.is_a?(Fixnum))
40
40
  end
41
-
41
+
42
42
  def resource_object(meth)
43
43
  @resource_object ||= resource_class(meth).new(@url, @auth, @xml, @options)
44
44
  end
45
-
45
+
46
46
  def resource_class(meth, *args)
47
47
  @resource_class ||= collection_call?(meth, *args) ? ResourceCollection : SingleResource
48
48
  end
49
-
49
+
50
50
  end
51
-
51
+
52
52
  def self.Resource(url, auth = nil, params = {})
53
53
  Resource.new(url, auth, nil, params)
54
54
  end
55
-
56
- end
55
+
56
+ end
@@ -1,3 +1,3 @@
1
1
  module Almodovar
2
- VERSION = '1.2.0'
2
+ VERSION = '1.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: almodovar
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - BeBanjo S.L.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-14 00:00:00.000000000 Z
11
+ date: 2016-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: builder
@@ -134,7 +134,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
134
134
  version: '0'
135
135
  requirements: []
136
136
  rubyforge_project:
137
- rubygems_version: 2.2.2
137
+ rubygems_version: 2.4.7
138
138
  signing_key:
139
139
  specification_version: 4
140
140
  summary: BeBanjo API client