binder_sdk 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/binder_sdk/resources/entry.rb +29 -0
- data/lib/binder_sdk/resources/resource.rb +23 -0
- data/lib/binder_sdk/resources/user.rb +1 -1
- data/lib/binder_sdk/{resource.rb → sdk_resource.rb} +3 -1
- data/lib/binder_sdk/version.rb +1 -1
- data/lib/binder_sdk.rb +1 -1
- data/test/resources/entry_test.rb +10 -0
- data/test/resources/resource_test.rb +10 -0
- data/test/resources/user_test.rb +2 -2
- data/test/{resource_test.rb → sdk_resource_test.rb} +1 -1
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b290ff942b64483a1f1d98f6601569b04819e91f
|
4
|
+
data.tar.gz: 52ffedb7be94b6c4b3fda4029df5a7fe51952262
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bda2cc791d0d99f5e11c4b724506edf1b36f178ca8873d86c395892d07c455323b71dc062d595a2d7c844bf40538e63f408261a79f7bcf9c192141c7c444e349
|
7
|
+
data.tar.gz: 87c4e7462a67374558c4482cb57e21df4ef966fe0ba146db102bab7b1dc5238747765d82a08f31b09362140373a0bdbc092f588121313c6c92884cb296cab647
|
data/CHANGELOG.md
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
module BinderSDK
|
2
|
+
class Entry < SDKResource
|
3
|
+
self.path = "/entries"
|
4
|
+
end
|
5
|
+
|
6
|
+
def user
|
7
|
+
@user ||= User.find(user_id)
|
8
|
+
end
|
9
|
+
|
10
|
+
def resource
|
11
|
+
@resource ||= Resource.find(resource_id)
|
12
|
+
end
|
13
|
+
|
14
|
+
def binder
|
15
|
+
@binder ||= Binder.find(resource_id)
|
16
|
+
end
|
17
|
+
|
18
|
+
class EntryMock < Entry
|
19
|
+
extend Loquor::ResourceMock
|
20
|
+
|
21
|
+
self.attributes = {
|
22
|
+
id: 50,
|
23
|
+
user_id: 30660,
|
24
|
+
resource_id: 17,
|
25
|
+
binder_id: 11,
|
26
|
+
order_value: 100
|
27
|
+
}
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module BinderSDK
|
2
|
+
class Resource < SDKResource
|
3
|
+
self.path = "/resources"
|
4
|
+
|
5
|
+
def entries
|
6
|
+
Entry.where(resource_id: self.id)
|
7
|
+
end
|
8
|
+
|
9
|
+
end
|
10
|
+
|
11
|
+
class ResourceMock < Resource
|
12
|
+
extend Loquor::ResourceMock
|
13
|
+
|
14
|
+
self.attributes = {
|
15
|
+
id: 1,
|
16
|
+
created_by_id: 1,
|
17
|
+
site_name: 'FooTube',
|
18
|
+
url: 'http://footube.example.com/foo/bar',
|
19
|
+
title: 'Foo Bar Baz',
|
20
|
+
description: 'The Foo Bar Baz mock external resource is a great FooTube video.'
|
21
|
+
}
|
22
|
+
end
|
23
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
module BinderSDK
|
2
|
-
class
|
2
|
+
class SDKResource < Loquor::Resource
|
3
3
|
include Helpers
|
4
4
|
|
5
5
|
def self.spi_type=(type)
|
@@ -20,6 +20,8 @@ RESOURCES = %w{
|
|
20
20
|
user
|
21
21
|
}
|
22
22
|
|
23
|
+
require "binder_sdk/resources/entry"
|
24
|
+
require "binder_sdk/resources/resource"
|
23
25
|
require "binder_sdk/resources/user"
|
24
26
|
RESOURCES.each do |resource|
|
25
27
|
require "binder_sdk/resources/#{resource}"
|
data/lib/binder_sdk/version.rb
CHANGED
data/lib/binder_sdk.rb
CHANGED
data/test/resources/user_test.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: binder_sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
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-06-
|
11
|
+
date: 2014-06-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -129,14 +129,18 @@ files:
|
|
129
129
|
- lib/binder_sdk/email_shortcodes.rb
|
130
130
|
- lib/binder_sdk/helpers.rb
|
131
131
|
- lib/binder_sdk/mocker.rb
|
132
|
-
- lib/binder_sdk/
|
132
|
+
- lib/binder_sdk/resources/entry.rb
|
133
|
+
- lib/binder_sdk/resources/resource.rb
|
133
134
|
- lib/binder_sdk/resources/user.rb
|
135
|
+
- lib/binder_sdk/sdk_resource.rb
|
134
136
|
- lib/binder_sdk/version.rb
|
135
137
|
- test/arbitary_test.rb
|
136
138
|
- test/configuration_test.rb
|
137
139
|
- test/mocker_test.rb
|
138
|
-
- test/
|
140
|
+
- test/resources/entry_test.rb
|
141
|
+
- test/resources/resource_test.rb
|
139
142
|
- test/resources/user_test.rb
|
143
|
+
- test/sdk_resource_test.rb
|
140
144
|
- test/test_helper.rb
|
141
145
|
homepage: http://github.com/meducation/binder_sdk
|
142
146
|
licenses:
|
@@ -166,6 +170,8 @@ test_files:
|
|
166
170
|
- test/arbitary_test.rb
|
167
171
|
- test/configuration_test.rb
|
168
172
|
- test/mocker_test.rb
|
169
|
-
- test/
|
173
|
+
- test/resources/entry_test.rb
|
174
|
+
- test/resources/resource_test.rb
|
170
175
|
- test/resources/user_test.rb
|
176
|
+
- test/sdk_resource_test.rb
|
171
177
|
- test/test_helper.rb
|