meducation_sdk 1.2.0 → 1.2.1

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: 3523ab619c1fb3b18096f1801ff62f8a61e51906
4
- data.tar.gz: 879201230b70991fe95f6e7a9aa1466f78455187
3
+ metadata.gz: b643cc213f1f63326785abe8533f3d93d14677f1
4
+ data.tar.gz: 6647a725736653c8812f558998a5ae7cbd79930b
5
5
  SHA512:
6
- metadata.gz: ed849a56f7f10ba5fbd7edcd3a542211f7790310e715710a6f642dc21bfa72a040a9f08436dcbece3b15c5925bc53350af4709340fa42c0321d2bdc8ad1f7bb0
7
- data.tar.gz: 1b1c94547e6187f986f92efed77f6757ebd4cd5dd3a72cf471b584551c5fb9b43ec9930445ee0cbb2adf16fe687080b8c8e72affcd390b9358784c13a6df7d91
6
+ metadata.gz: cac0dbe55601b4eeb3596bc8b8018932fb3c252f67a32bac65795e0aea261d3dbc747bc13be1fd1938177395b16e1b8f0f55bb890785d29c7d2364ec46397676
7
+ data.tar.gz: 4113d3b7eb473793004a269bd2a4c5482b19333928c62c7cf1764c007fc2800d54a3b9c27e5946b27daabbdde360f61b986fb0a978c5a044f3e68229da5eaa9e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ # 1.2.1 / 2014-02-03
2
+ * [FEATURE] Add support for Collections and Sections
3
+
1
4
  # 1.2.0 / 2014-02-01
2
5
  * [FEATURE] Add support for Collection Topics
3
6
  * [FEATURE] Remove support for Premium Tutorials
@@ -0,0 +1,28 @@
1
+ module MeducationSDK
2
+
3
+ class Collection < Loquor::Resource
4
+
5
+ self.path = "/collections"
6
+
7
+ def sections
8
+ @sections ||= Section.where(collection_id: id)
9
+ end
10
+
11
+ end
12
+
13
+ class CollectionMock < Collection
14
+ extend Loquor::ResourceMock
15
+
16
+ self.attributes = {
17
+ id: 7,
18
+ title: 'This is a mock collection',
19
+ description: 'This is a sample description',
20
+ market_description: 'This is a sample market description',
21
+ section_ids: [2,3,4,5,6],
22
+ topic_ids: [1,2,3,4],
23
+ resource_ids: [9,8,7,6]
24
+ }
25
+
26
+ end
27
+
28
+ end
@@ -0,0 +1,27 @@
1
+ module MeducationSDK
2
+
3
+ class CollectionSection < Loquor::Resource
4
+
5
+ self.path = "/collection_sections"
6
+
7
+ def topics
8
+ @topics ||= Section.where(section_id: id)
9
+ end
10
+
11
+ end
12
+
13
+ class CollectionSectionMock < Collection
14
+ extend Loquor::ResourceMock
15
+
16
+ self.attributes = {
17
+ id: 463728,
18
+ title: 'This is a mock collection section',
19
+ description: 'This is a sample description',
20
+ collection_id: 1,
21
+ topic_ids: [1,2,4],
22
+ resource_ids: [9,8]
23
+ }
24
+
25
+ end
26
+
27
+ end
@@ -1,5 +1,7 @@
1
1
  module MeducationSDK
2
+
2
3
  class CollectionTopic < Loquor::Resource
4
+
3
5
  self.path = "/collection_topics"
4
6
 
5
7
  def user
@@ -9,18 +11,24 @@ module MeducationSDK
9
11
  def comments
10
12
  @comments ||= Comment.where(id: comment_ids)
11
13
  end
14
+
12
15
  end
13
16
 
14
17
  class CollectionTopicMock < CollectionTopic
15
18
  extend Loquor::ResourceMock
16
19
 
17
20
  self.attributes = {
18
- id: 1,
19
- title: "Al's Medicine Tutorial",
20
- comment_ids: [4,5,6],
21
- rating: 10,
22
- views_in_last_30_days: 30,
23
- views_in_last_60_days: 60
21
+ id: 728463,
22
+ title: 'This is a mock collection topic',
23
+ description: 'This is a sample description',
24
+ collection_id: 1,
25
+ section_id: 17,
26
+ resource_ids: [3, 4, 5],
27
+ views_in_last_30_days: 1,
28
+ views_in_last_60_days: 2,
29
+ rating: 123
24
30
  }
31
+
25
32
  end
33
+
26
34
  end
@@ -1,3 +1,3 @@
1
1
  module MeducationSDK
2
- VERSION = "1.2.0"
2
+ VERSION = "1.2.1"
3
3
  end
@@ -6,6 +6,8 @@ require "meducation_sdk/configuration"
6
6
  require "meducation_sdk/mocker"
7
7
 
8
8
  RESOURCES = %w{
9
+ collection
10
+ collection_section
9
11
  collection_topic
10
12
  comment
11
13
  community
@@ -0,0 +1,9 @@
1
+ require File.expand_path('../../test_helper', __FILE__)
2
+ require File.expand_path('../../resource_test', __FILE__)
3
+
4
+ module MeducationSDK
5
+ class CollectionSectionTest < ResourceTest
6
+ test_resource(CollectionSection, '/collection_sections')
7
+ end
8
+ end
9
+
@@ -0,0 +1,9 @@
1
+ require File.expand_path('../../test_helper', __FILE__)
2
+ require File.expand_path('../../resource_test', __FILE__)
3
+
4
+ module MeducationSDK
5
+ class CollectionTest < ResourceTest
6
+ test_resource(Collection, '/collections')
7
+ end
8
+ end
9
+
@@ -6,8 +6,8 @@ module MeducationSDK
6
6
  test_resource(CollectionTopic, '/collection_topics')
7
7
 
8
8
  def test_comments_calls_sdk
9
- topic = CollectionTopic.new(comment_ids: [7,8,9])
10
- MeducationSDK::Comment.expects(:where).with(id: [7,8,9])
9
+ topic = CollectionTopic.new(comment_ids: [7, 8, 9])
10
+ MeducationSDK::Comment.expects(:where).with(id: [7, 8, 9])
11
11
  topic.comments
12
12
  end
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meducation_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeremy Walker
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-02 00:00:00.000000000 Z
11
+ date: 2014-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -112,6 +112,8 @@ files:
112
112
  - lib/meducation_sdk.rb
113
113
  - lib/meducation_sdk/configuration.rb
114
114
  - lib/meducation_sdk/mocker.rb
115
+ - lib/meducation_sdk/resources/collection.rb
116
+ - lib/meducation_sdk/resources/collection_section.rb
115
117
  - lib/meducation_sdk/resources/collection_topic.rb
116
118
  - lib/meducation_sdk/resources/comment.rb
117
119
  - lib/meducation_sdk/resources/community.rb
@@ -142,6 +144,8 @@ files:
142
144
  - test/configuration_test.rb
143
145
  - test/mocker_test.rb
144
146
  - test/resource_test.rb
147
+ - test/resources/collection_section_test.rb
148
+ - test/resources/collection_test.rb
145
149
  - test/resources/collection_topic_test.rb
146
150
  - test/resources/comment_test.rb
147
151
  - test/resources/community_membership_test.rb
@@ -187,7 +191,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
187
191
  version: '0'
188
192
  requirements: []
189
193
  rubyforge_project:
190
- rubygems_version: 2.1.9
194
+ rubygems_version: 2.2.0
191
195
  signing_key:
192
196
  specification_version: 4
193
197
  summary: The SDK for Meducation
@@ -196,6 +200,8 @@ test_files:
196
200
  - test/configuration_test.rb
197
201
  - test/mocker_test.rb
198
202
  - test/resource_test.rb
203
+ - test/resources/collection_section_test.rb
204
+ - test/resources/collection_test.rb
199
205
  - test/resources/collection_topic_test.rb
200
206
  - test/resources/comment_test.rb
201
207
  - test/resources/community_membership_test.rb
@@ -221,4 +227,3 @@ test_files:
221
227
  - test/resources/user_settings_test.rb
222
228
  - test/resources/user_test.rb
223
229
  - test/test_helper.rb
224
- has_rdoc: