boxspring 0.0.5 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 679f26a51cb69b455bd097b1fcfbdd32f0dfe9e7
4
- data.tar.gz: 5d89c2bb387be76e3a71a1747cd2b29d7b16df39
3
+ metadata.gz: ee15de1117b4ee66a7c3791765660298d1f302a8
4
+ data.tar.gz: cdca1d46c65ac08b393b05e5ff8abe0099a7a769
5
5
  SHA512:
6
- metadata.gz: 0110905ac756256abfd2b2e25a08c5cf34fc2b2991056f47ce26495f6cb247f92c962e97ce93da9a2fab0334fdc780d998f98f8f93e6fbe41d60fe450db66fd5
7
- data.tar.gz: f9ff213556dc2ebdb9748d5ec02b989e5e5b5ab7f37f9a4104f6f9617e462e53932b7311ee80459431a56565f88550f79433e0d3273622772f0905873a6b748f
6
+ metadata.gz: 4b42ebf014e049684d64157f33ab401f518de6597fb33cb8293e0fbd37c68d4499b8f3ba6002a05bdbfc6ddf89592643a8e0c32643371b439dd7914f04a52146
7
+ data.tar.gz: 9cd79302ef3d65a4fe96b3ebc52f608b197f46137d2715a130f0f6eb685e002aaab5ba3d91b7f44f0ff75999966e4af5a3e8cfd0f063292a8229449aff96d382
@@ -1,18 +1,22 @@
1
1
  module Boxspring
2
-
2
+
3
3
  class Attribution < Base
4
4
 
5
5
  include Taggable
6
+ include Pictureable
6
7
 
7
- field :created_at
8
- field :updated_at
8
+ field :created_at
9
+ field :updated_at
9
10
 
10
- field :id
11
- field :name
11
+ field :id
12
+ field :name
12
13
  field :url
14
+ field :stories_count
15
+ field :pictures
16
+ field :picture_id
13
17
 
14
18
  field :slug
15
19
 
16
20
  end
17
21
 
18
- end
22
+ end
@@ -0,0 +1,14 @@
1
+ module Boxspring
2
+
3
+ class Picture < Base
4
+
5
+ field :created_at
6
+ field :updated_at
7
+
8
+ field :id
9
+ field :code_name
10
+ field :filename
11
+
12
+ end
13
+
14
+ end
@@ -0,0 +1,21 @@
1
+ module Boxspring
2
+
3
+ module Pictureable
4
+
5
+ def pictures
6
+ @_pictures ||= begin
7
+ self.attributes.include?( :pictures ) ?
8
+ self.attributes[ :pictures ].map do | picture |
9
+ Picture.new( picture )
10
+ end :
11
+ nil
12
+ end
13
+ end
14
+
15
+ def picture_by_code_name(code_name)
16
+ self.pictures.detect{ |picture| picture.code_name == code_name }
17
+ end
18
+
19
+ end
20
+
21
+ end
@@ -3,7 +3,7 @@ module Boxspring
3
3
  class Property < Base
4
4
 
5
5
  def self.find_by( parameters )
6
-
6
+
7
7
  # filter only acceptable parameters
8
8
  parameters = parameters.stringify_keys.slice(
9
9
  'code_name', 'domain_name'
@@ -24,33 +24,47 @@ module Boxspring
24
24
  Property.new( response.content ).tap do | property |
25
25
  property.instance_variable_set( '@api_interface', request )
26
26
  end
27
-
27
+
28
28
  end
29
29
 
30
- field :created_at
31
- field :updated_at
32
- field :destroyed_at
30
+ field :created_at
31
+ field :updated_at
32
+ field :destroyed_at
33
33
 
34
- field :name
34
+ field :name
35
35
  field :code_name
36
36
  field :domain_name
37
37
 
38
38
  field :meta_description
39
- field :meta_title
39
+ field :meta_title
40
40
 
41
41
  def theme
42
42
  @_theme ||= begin
43
- self.attributes.include?( :theme ) ?
43
+ self.attributes.include?( :theme ) ?
44
44
  Theme.new( self.attributes[ :theme ] ) :
45
45
  nil
46
46
  end
47
47
  end
48
48
 
49
+ def services
50
+ @_services ||= begin
51
+ self.attributes.include?( :services ) ?
52
+ self.attributes[ :services ].map do | service |
53
+ Service.new( service )
54
+ end :
55
+ nil
56
+ end
57
+ end
58
+
59
+ def service_by_provider( provider )
60
+ self.services.detect { |service| service.provider == provider }
61
+ end
62
+
49
63
  def tag_collections( reload = false )
50
64
  @_tag_collections ||= begin
51
- self.attributes.include?( :tag_collections ) ?
65
+ self.attributes.include?( :tag_collections ) ?
52
66
  self.attributes[ :tag_collections ].map do | tag_collection |
53
- TagCollection.new( tag_collection )
67
+ TagCollection.new( tag_collection )
54
68
  end :
55
69
  nil
56
70
  end
@@ -80,16 +94,16 @@ module Boxspring
80
94
 
81
95
  def shows
82
96
  @_shows ||= begin
83
- self.attributes.include?( :shows ) ?
97
+ self.attributes.include?( :shows ) ?
84
98
  self.attributes[ :shows ].map do | show |
85
- Show.new( show )
99
+ Show.new( show )
86
100
  end :
87
101
  nil
88
102
  end
89
103
  end
90
104
 
91
- def attribution_by_id( id )
92
- response = @api_interface.get( "/attributions/#{id}" )
105
+ def attribution_by_id( id, parameters = {} )
106
+ response = @api_interface.get( "/attributions/#{id}", parameters )
93
107
  if ( response.success? )
94
108
  Attribution.new( response.content )
95
109
  elsif ( response.code == '404' )
@@ -99,6 +113,17 @@ module Boxspring
99
113
  end
100
114
  end
101
115
 
116
+ def reaction_by_id( id )
117
+ response = @api_interface.get( "/reactions/#{id}" )
118
+ if ( response.success? )
119
+ Reaction.new( response.content )
120
+ elsif ( response.code == '404' )
121
+ nil
122
+ else
123
+ raise response.error
124
+ end
125
+ end
126
+
102
127
  def videos( parameters = {} )
103
128
  response = @api_interface.get( "/videos", parameters )
104
129
  if ( response.success? )
@@ -109,7 +134,7 @@ module Boxspring
109
134
  nil
110
135
  else
111
136
  raise response.error
112
- end
137
+ end
113
138
  end
114
139
 
115
140
  def shows_videos( parameters = {} )
@@ -122,7 +147,7 @@ module Boxspring
122
147
  nil
123
148
  else
124
149
  raise response.error
125
- end
150
+ end
126
151
  end
127
152
 
128
153
  def video_by_id( id )
@@ -138,4 +163,4 @@ module Boxspring
138
163
 
139
164
  end
140
165
 
141
- end
166
+ end
@@ -0,0 +1,18 @@
1
+ module Boxspring
2
+
3
+ class Reaction < Base
4
+
5
+ field :created_at
6
+ field :updated_at
7
+ field :reaction_order
8
+
9
+ field :id
10
+ field :name
11
+ field :code_name
12
+ field :stories_count
13
+
14
+ field :slug
15
+
16
+ end
17
+
18
+ end
@@ -0,0 +1,14 @@
1
+ module Boxspring
2
+
3
+ class Service < Base
4
+
5
+ field :created_at
6
+ field :updated_at
7
+
8
+ field :id
9
+ field :provider
10
+ field :public_settings
11
+
12
+ end
13
+
14
+ end
@@ -1,15 +1,15 @@
1
1
  module Boxspring
2
-
2
+
3
3
  class Show < Base
4
4
 
5
5
  include Taggable
6
6
 
7
- field :created_at
8
- field :updated_at
7
+ field :created_at
8
+ field :updated_at
9
9
  field :published_at
10
10
 
11
- field :id
12
- field :name
11
+ field :id
12
+ field :name
13
13
  field :short_description
14
14
  field :description
15
15
  field :schedule
@@ -18,6 +18,8 @@ module Boxspring
18
18
  field :picture_medium_id
19
19
  field :picture_small_id
20
20
 
21
+ field :stories_count
22
+
21
23
  field :meta_description
22
24
  field :meta_title
23
25
 
@@ -28,9 +30,9 @@ module Boxspring
28
30
  end
29
31
 
30
32
  def private
31
- @_private || false
33
+ @_private || false
32
34
  end
33
35
 
34
36
  end
35
37
 
36
- end
38
+ end
@@ -0,0 +1,15 @@
1
+ module Boxspring
2
+
3
+ class Sponsor < Base
4
+
5
+ field :created_at
6
+ field :updated_at
7
+
8
+ field :id
9
+ field :name
10
+ field :picture_id
11
+ field :stories_count
12
+
13
+ end
14
+
15
+ end
data/lib/boxspring/tag.rb CHANGED
@@ -2,15 +2,17 @@ module Boxspring
2
2
 
3
3
  class Tag < Base
4
4
 
5
- field :created_at
6
- field :updated_at
5
+ field :created_at
6
+ field :updated_at
7
7
 
8
- field :id
9
- field :code_name
8
+ field :id
9
+ field :code_name
10
10
  field :canonical_name
11
- field :name
11
+ field :name
12
12
  field :slug
13
13
 
14
+ field :stories_count
15
+
14
16
  field :picture_id
15
17
 
16
18
  def private=( _private )
@@ -18,9 +20,9 @@ module Boxspring
18
20
  end
19
21
 
20
22
  def private
21
- @_private || false
23
+ @_private || false
22
24
  end
23
25
 
24
26
  end
25
27
 
26
- end
28
+ end
@@ -1,3 +1,3 @@
1
1
  module Boxspring
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
@@ -1,22 +1,22 @@
1
1
  module Boxspring
2
-
2
+
3
3
  class Video < Base
4
4
 
5
5
  include Taggable
6
6
 
7
- field :created_at
8
- field :updated_at
7
+ field :created_at
8
+ field :updated_at
9
9
  field :uploaded_at
10
10
  field :published_at
11
11
  field :featured_at
12
12
 
13
13
  field :status
14
- field :original
14
+ field :original
15
15
  field :publishing_sequence
16
16
 
17
17
  field :type_name
18
- field :id
19
- field :name
18
+ field :id
19
+ field :name
20
20
  field :tagline
21
21
  field :short_description
22
22
  field :description
@@ -36,7 +36,7 @@ module Boxspring
36
36
  field :provider_title
37
37
  field :provider_description
38
38
  field :provider_url
39
-
39
+
40
40
  field :duration
41
41
  field :action_participations_count
42
42
  field :react_actions_counts
@@ -44,7 +44,7 @@ module Boxspring
44
44
 
45
45
  def show
46
46
  @_show ||= begin
47
- self.attributes.include?( :show ) ?
47
+ self.attributes.include?( :show ) ?
48
48
  Show.new( show ) :
49
49
  nil
50
50
  end
@@ -52,4 +52,4 @@ module Boxspring
52
52
 
53
53
  end
54
54
 
55
- end
55
+ end
data/lib/boxspring.rb CHANGED
@@ -9,7 +9,12 @@ require 'boxspring/request'
9
9
  require 'boxspring/base'
10
10
  require 'boxspring/tag'
11
11
  require 'boxspring/taggable'
12
+ require 'boxspring/picture'
13
+ require 'boxspring/pictureable'
12
14
  require 'boxspring/attribution'
15
+ require 'boxspring/reaction'
16
+ require 'boxspring/sponsor'
17
+ require 'boxspring/service'
13
18
  require 'boxspring/show'
14
19
  require 'boxspring/tag_collection'
15
20
  require 'boxspring/user_agent'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: boxspring
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kristoph Cichocki-Romanov
@@ -78,10 +78,15 @@ files:
78
78
  - lib/boxspring/base.rb
79
79
  - lib/boxspring/configuration.rb
80
80
  - lib/boxspring/error.rb
81
+ - lib/boxspring/picture.rb
82
+ - lib/boxspring/pictureable.rb
81
83
  - lib/boxspring/property.rb
84
+ - lib/boxspring/reaction.rb
82
85
  - lib/boxspring/request.rb
83
86
  - lib/boxspring/response.rb
87
+ - lib/boxspring/service.rb
84
88
  - lib/boxspring/show.rb
89
+ - lib/boxspring/sponsor.rb
85
90
  - lib/boxspring/tag.rb
86
91
  - lib/boxspring/tag_collection.rb
87
92
  - lib/boxspring/taggable.rb