one45 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 16dc956d8f62c8d9d3e2f891d57b92c9a74a9bb2
4
- data.tar.gz: cd6ce58c8b2faca3a4ba250a9a219d4ba1e06f46
3
+ metadata.gz: 31da719f0b6cb4f24314e92b73345ab9a8f5bb87
4
+ data.tar.gz: 3fbe55869abc7ebf3c00f041f07f427fc6e3928f
5
5
  SHA512:
6
- metadata.gz: e13dd53ac33f7c098fa29230195184c613d4d53042ee5b4ca8864da1f05089c1a37c540ec30a26f0c1162f1effdb02d9aa0456ebc196babfa0cbcc6de08d9acd
7
- data.tar.gz: 742d0d3585d0df43c780920e2fa628f8fda980564419e6b3b9eb3e6e4b5a6ab391f61723367f59f42c0a7760102c1fc9c82c044df2e75bfdcb4bee9120e21765
6
+ metadata.gz: 3c82f215abddc305473ab2e16ca9f7bd142824148b1eb7a64395f55eb6a19253fc70bc2af8313cbd77f9518388fbc83e0a79b430d67f0a711c5c41c9eb61d1c7
7
+ data.tar.gz: 18351382c8ff60616eca7dde859071e239e8264cf36e49776e985ce1148fe9ef820fa68be729703419cd2d300d4778fed94afde20ef98fcdd5a8566978dcc55f
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Ruby bindings for the [one45 API](https://api.one45.com/api/docs/all).
4
4
 
5
- Under development since most endpoints remain listed as Early Access/In Development.
5
+ Under development since most endpoints remain listed as `Early Access/In Development`.
6
6
 
7
7
  ## Installation
8
8
 
@@ -31,10 +31,10 @@ One45.client_secret = ENV['ONE45_CLIENT_SECRET']
31
31
  One45.access_token = ENV['ONE45_ACCESS_TOKEN'] # optional
32
32
  ```
33
33
 
34
- A request for a new token will be made prior to each call if no access token provided (which is slowing response).
34
+ A request for a new token will be made prior to each call if no access token provided (which is slowing down response time).
35
35
  In future, an alternate solution would be to implement OAuth2 strategy.
36
36
 
37
- Retrieve collection
37
+ ### Retrieving a collection of objects (users, groups, forms...)
38
38
 
39
39
  ```
40
40
  One45::Evaluations.list(
@@ -47,18 +47,32 @@ One45::Evaluations.list(
47
47
  )
48
48
  ```
49
49
 
50
- Fetch specific record by One45 ID
50
+ ### Retrieving a single object
51
+
52
+ Fetch specific record by its One45 ID
51
53
 
52
54
  ```
53
55
  One45::Questions.find(504)
54
56
  ```
55
57
 
58
+ ### Entities Implemented
59
+
60
+ Entity | Methods
61
+ -- | --
62
+ Evaluation | list, find, answers, contributors, question_answers
63
+ Event | ahd_events, ahd_event, ahd_attendees, curriculum_events, curriculum_event, curriculum_event_attendees, curriculum_event_children, rotation_events, rotation_event, rotation_attendees
64
+ Form | list, find, groups, questions
65
+ Group | list, find, subgroups
66
+ Question | list, find
67
+ Rotation | list, find
68
+ People (as user) | list, find, preferences, todos, evaluations
69
+
56
70
  __Current limits__
57
71
 
58
- - Only GET methods so far (POST, DELETE, PATCH, PUT are excluded at the moment)
59
- - Only token#generate is implemented
72
+ - Support for GET methods only at the moment (POST, DELETE, PATCH, PUT are excluded)
73
+ - Regarding token entity, only token#generate method is implemented through `One45.generate_token(One45.client_key, One45.client_secret)`
60
74
 
61
- For complete list of implementation please refer to test file.
75
+ For complete implementation please refer to the test file.
62
76
 
63
77
  ## Development
64
78
 
@@ -8,6 +8,7 @@ require "one45/base"
8
8
 
9
9
  # API resources
10
10
  require "one45/evaluations"
11
+ require "one45/events"
11
12
  require "one45/forms"
12
13
  require "one45/groups"
13
14
  require "one45/questions"
@@ -32,7 +33,7 @@ module One45
32
33
  # puts "generated access_token: #{@access_token}"
33
34
  @access_token
34
35
  rescue => e
35
- One45Error.new("error: #{e.class} : #{e.response} : #{e.response}")
36
+ One45Error.new("#{e.class} - #{e.response}")
36
37
  end
37
38
  end
38
39
 
@@ -0,0 +1,64 @@
1
+ module One45
2
+ class Events < Base
3
+
4
+ def self.academic_half_day_events(options = {})
5
+ url = "#{resource_url}/ahd"
6
+ One45.get url
7
+ end
8
+ singleton_class.send(:alias_method, :ahd_events, :academic_half_day_events)
9
+
10
+ def self.academic_half_day_event(id)
11
+ url = "#{resource_url}/ahd/#{id}"
12
+ One45.get url
13
+ end
14
+ singleton_class.send(:alias_method, :ahd_event, :academic_half_day_event)
15
+
16
+ def self.academic_half_day_attendees(id)
17
+ url = "#{resource_url}/ahd/#{id}/attendees"
18
+ One45.get url
19
+ end
20
+ singleton_class.send(:alias_method, :ahd_attendees, :academic_half_day_attendees)
21
+
22
+ def self.curriculum_events(options = {})
23
+ url = "#{resource_url}/curriculum"
24
+ One45.get url
25
+ end
26
+
27
+ def self.curriculum_event(id)
28
+ url = "#{resource_url}/curriculum/#{id}"
29
+ One45.get url
30
+ end
31
+
32
+ def self.curriculum_event_attendees(id)
33
+ url = "#{resource_url}/curriculum/#{id}/attendees"
34
+ One45.get url
35
+ end
36
+
37
+ def self.curriculum_event_children(id)
38
+ url = "#{resource_url}/curriculum/#{id}/children"
39
+ One45.get url
40
+ end
41
+
42
+ def self.rotation_events(options = {})
43
+ url = "#{resource_url}/rotation"
44
+ One45.get url
45
+ end
46
+
47
+ def self.rotation_event(id)
48
+ url = "#{resource_url}/rotation/#{id}"
49
+ One45.get url
50
+ end
51
+
52
+ def self.rotation_attendees(id)
53
+ url = "#{resource_url}/rotation/#{id}/attendees"
54
+ One45.get url
55
+ end
56
+
57
+ private
58
+
59
+ def self.resource_url
60
+ "events"
61
+ end
62
+
63
+ end
64
+ end
@@ -1,3 +1,3 @@
1
1
  module One45
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: one45
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Olivier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-27 00:00:00.000000000 Z
11
+ date: 2016-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client
@@ -127,6 +127,7 @@ files:
127
127
  - lib/one45/base.rb
128
128
  - lib/one45/errors/one45_error.rb
129
129
  - lib/one45/evaluations.rb
130
+ - lib/one45/events.rb
130
131
  - lib/one45/forms.rb
131
132
  - lib/one45/groups.rb
132
133
  - lib/one45/questions.rb