boxspring 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/boxspring/property.rb +12 -6
- data/lib/boxspring/response.rb +2 -2
- data/lib/boxspring/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: e4d79505ec21a254c383e5374b5965fc564be603
|
4
|
+
data.tar.gz: 0f1377902122fe6f961474542a6290d56947096f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f5d7cee56673bae333b6dab07be256e6fca1bbb3c649218719e27988632227d9ce19cf26d22491cb239d7f233423e9a1f1eeb5abb361794ea2c8edae0730efa
|
7
|
+
data.tar.gz: 8d1421646f86a83ee68742817c1417d8e18896bf9e7783c8f7527b6e35b7b1f06db80e2337129d46cf22d30d40ea5cf08c492e96d0ab67e3844e31a4733ac13e
|
data/lib/boxspring/property.rb
CHANGED
@@ -17,15 +17,21 @@ module Boxspring
|
|
17
17
|
parameters[ 'property_domain_name' ] = parameters.delete( 'domain_name' ) \
|
18
18
|
if parameters.include?( 'domain_name' )
|
19
19
|
|
20
|
-
# create and make the request
|
20
|
+
# create and make the request
|
21
21
|
request = Request.new( parameters )
|
22
22
|
response = request.get( '/configuration' )
|
23
|
-
raise response.error if response.failure?
|
24
23
|
|
25
|
-
#
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
# did the api request succeed
|
25
|
+
if ( response.success? )
|
26
|
+
# construct a property; assign it the api interface
|
27
|
+
Property.new( response.content ).tap do | property |
|
28
|
+
property.instance_variable_set( '@api_interface', request )
|
29
|
+
end
|
30
|
+
elsif ( response.code == '404' )
|
31
|
+
nil
|
32
|
+
else
|
33
|
+
raise response.error
|
34
|
+
end
|
29
35
|
|
30
36
|
end
|
31
37
|
|
data/lib/boxspring/response.rb
CHANGED
@@ -12,14 +12,14 @@ module Boxspring
|
|
12
12
|
@content = decode_response_body( http_response )
|
13
13
|
error = @content.respond_to?( :keys ) ? @content[ 'errors' ] : nil
|
14
14
|
|
15
|
-
if @content.respond_to?( :include? ) && @content.include?(
|
15
|
+
if @content.respond_to?( :include? ) && @content.include?( 'errors' )
|
16
16
|
@error =
|
17
17
|
Boxspring::Error.new( @content[ 'errors' ][ 'message' ] )
|
18
18
|
end
|
19
19
|
|
20
20
|
@success =
|
21
21
|
http_response.is_a?( Net::HTTPOK ) &&
|
22
|
-
@content &&
|
22
|
+
@content.present? &&
|
23
23
|
@error.nil?
|
24
24
|
|
25
25
|
@error = Boxspring::Error.new( 'unknown' ) \
|
data/lib/boxspring/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxspring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kristoph Cichocki-Romanov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|