boxspring 0.1.3 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/boxspring.rb +1 -0
- data/lib/boxspring/page.rb +18 -0
- data/lib/boxspring/property.rb +28 -3
- data/lib/boxspring/response.rb +1 -1
- data/lib/boxspring/version.rb +2 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09830de236195049509da43c4dd2173ba7c1c97b
|
4
|
+
data.tar.gz: 3da588b61fa9c478c60d14f57d159b18e1483b20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6b59f02a88834f4baedcdf9b54781addb4594c894690800912d2dd0fc06a9311c0acec4f7c51daa8a9d96978452fbae5c2e5765c0c933a00cd532bd38874e10b
|
7
|
+
data.tar.gz: c1b529572ffd823b3c9af17f439d6a5e32972247373ecb9884170c585eaa4ae3e5a0c0cbbcb1b173af42fe4c04db597f766b0d66c7a581353152a6dbc7a5a67a
|
data/lib/boxspring.rb
CHANGED
data/lib/boxspring/property.rb
CHANGED
@@ -21,7 +21,7 @@ module Boxspring
|
|
21
21
|
request = Request.new( parameters )
|
22
22
|
response = request.get( '/configuration' )
|
23
23
|
|
24
|
-
# did the api request succeed
|
24
|
+
# did the api request succeed
|
25
25
|
if ( response.success? )
|
26
26
|
# construct a property; assign it the api interface
|
27
27
|
Property.new( response.content ).tap do | property |
|
@@ -72,6 +72,31 @@ module Boxspring
|
|
72
72
|
self.services.detect { |service| service.provider == provider }
|
73
73
|
end
|
74
74
|
|
75
|
+
def pages( parameters = {} )
|
76
|
+
@pages ||= begin
|
77
|
+
self.attributes.include?( :pages ) ?
|
78
|
+
self.attributes[ :pages ].map do | page |
|
79
|
+
Page.new( page )
|
80
|
+
end :
|
81
|
+
nil
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
def page_by_code_name( code_name )
|
86
|
+
self.pages.detect { |page| page.code_name == code_name }
|
87
|
+
end
|
88
|
+
|
89
|
+
def page_by_id( id )
|
90
|
+
response = @api_interface.get( "/pages/#{id}" )
|
91
|
+
if ( response.success? )
|
92
|
+
Page.new( response.content )
|
93
|
+
elsif ( response.code == '404' )
|
94
|
+
nil
|
95
|
+
else
|
96
|
+
raise response.error
|
97
|
+
end
|
98
|
+
end
|
99
|
+
|
75
100
|
def tag_collections( reload = false )
|
76
101
|
@_tag_collections ||= begin
|
77
102
|
self.attributes.include?( :tag_collections ) ?
|
@@ -162,8 +187,8 @@ module Boxspring
|
|
162
187
|
end
|
163
188
|
end
|
164
189
|
|
165
|
-
def story_by_id( id )
|
166
|
-
response = @api_interface.get( "/stories/#{id}" )
|
190
|
+
def story_by_id( id, parameters = {} )
|
191
|
+
response = @api_interface.get( "/stories/#{id}", parameters )
|
167
192
|
if ( response.success? )
|
168
193
|
Story.new( response.content )
|
169
194
|
elsif ( response.code == '404' )
|
data/lib/boxspring/response.rb
CHANGED
data/lib/boxspring/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Boxspring
|
2
|
-
VERSION = '0.1.
|
3
|
-
end
|
2
|
+
VERSION = '0.1.5'
|
3
|
+
end
|
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.1.
|
4
|
+
version: 0.1.5
|
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-
|
11
|
+
date: 2014-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -80,6 +80,7 @@ files:
|
|
80
80
|
- lib/boxspring/card.rb
|
81
81
|
- lib/boxspring/configuration.rb
|
82
82
|
- lib/boxspring/error.rb
|
83
|
+
- lib/boxspring/page.rb
|
83
84
|
- lib/boxspring/picture.rb
|
84
85
|
- lib/boxspring/pictureable.rb
|
85
86
|
- lib/boxspring/property.rb
|