fortytwo 0.1.0 → 0.1.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: abd620c14ed354ce605b6343943e871f7869dd74
4
- data.tar.gz: 8ecd25b3b5c19d098543cb6100e1a9e73dc8b50b
3
+ metadata.gz: 48cc8a78ff6272711bb718150566dbecae564b82
4
+ data.tar.gz: f24170785dfeec0afba650ff977a16123a326337
5
5
  SHA512:
6
- metadata.gz: 47273245d672620abe80beb1640a37d12553d7d489589f2bb43c6615984bc8ad70986063fc54732b88f7340e3e9e5e07eaa86773c6b9f42f175a80dcc0be087b
7
- data.tar.gz: 9328df0ccd0066c74d66d6cb09267adc35a395e8a5f6a5ea2e76a01b7b5170fb4de6abfa5e5e48462a00bd041abea3781d8618d1616f3ec639e8a17d8b7fbe58
6
+ metadata.gz: c4f61dae46bafa4f010693c58dc34014474c1c0f71b8ff442768244ae100a86b99f109ac8756a51843703e90ca61bf5088e634dcb32291c03ed82c7855a5a5ac
7
+ data.tar.gz: c18397ff8d90cdb5c18d9ef0cd36b1a64e7bced69e615479625852b856a8e536f0706848713fcd496a908aa6b32a1aaf93e096cbaf25f29c646919522242b177
data/README.md CHANGED
@@ -50,90 +50,92 @@ Responses from the API are all parsed and converted into Ruby objects. This way,
50
50
  response = client.user("mfernand")
51
51
  user = response.user
52
52
 
53
- user.id #=> 19619
54
- user.email #=> "mfernand@student.42.us.org"
55
- user.login #=> "mfernand"
56
- user.first_name #=> "Matias"
57
- user.last_name #=> "Fernandez"
58
- user.url #=> "https://api.intra.42.fr/v2/users/mfernand"
59
- user.phone #=> nil
60
- user.url #=> "https://api.intra.42.fr/v2/users/mfernand"
61
- user.displayname #=> "Matias Fernandez"
62
- user.image_url #=> "https://cdn.intra.42.fr/users/mfernand.jpg"
63
- user.staff #=> false
64
- user.correction_point #=> 2
65
- user.pool_month #=> "july"
66
- user.pool_year #=> "2016"
67
- user.location #=> nil
68
- user.wallet #=> 0
69
- user.groups #=> []
53
+ user.id #=> 19619
54
+ user.email #=> "mfernand@student.42.us.org"
55
+ user.login #=> "mfernand"
56
+ user.first_name #=> "Matias"
57
+ user.last_name #=> "Fernandez"
58
+ user.url #=> "https://api.intra.42.fr/v2/users/mfernand"
59
+ user.phone #=> nil
60
+ user.url #=> "https://api.intra.42.fr/v2/users/mfernand"
61
+ user.displayname #=> "Matias Fernandez"
62
+ user.image_url #=> "https://cdn.intra.42.fr/users/mfernand.jpg"
63
+ user.staff #=> false
64
+ user.correction_point #=> 2
65
+ user.pool_month #=> "july"
66
+ user.pool_year #=> "2016"
67
+ user.location #=> nil
68
+ user.wallet #=> 0
69
+ user.groups #=> []
70
70
 
71
71
  user.cursus_users.each do |user_cursus|
72
- user_cursus.id #=> 14121
73
- user_cursus.begin_at #=> "2016-09-19T22:00:00.000Z"
74
- user_cursus.end_at #=> nil
75
- user_cursus.grade #=> "Midshipman"
76
- user_cursus.level #=> 3.91
77
- user_cursus.skills #=> nil
78
- user_cursus.cursus_id #=> 1
79
-
80
- user_cursus.cursus.id #=> 1
81
- user_cursus.cursus.created_at #=> "2014-11-02T16:43:38.480Z"
82
- user_cursus.cursus.name #=> "42"
83
- user_cursus.cursus.slug #=> "42"
72
+ user_cursus.id #=> 14121
73
+ user_cursus.begin_at #=> "2016-09-19T22:00:00.000Z"
74
+ user_cursus.end_at #=> nil
75
+ user_cursus.grade #=> "Midshipman"
76
+ user_cursus.level #=> 3.91
77
+ user_cursus.skills #=> nil
78
+ user_cursus.cursus_id #=> 1
79
+
80
+ user_cursus.cursus.id #=> 1
81
+ user_cursus.cursus.created_at #=> "2014-11-02T16:43:38.480Z"
82
+ user_cursus.cursus.name #=> "42"
83
+ user_cursus.cursus.slug #=> "42"
84
84
  end
85
85
 
86
86
  user.projects_users.each do |user_project|
87
- user_project.id #=> 405588
88
- user_project.occurence #=> nil
89
- user_project.final_mark #=> 115
90
- user_project.status #=> "finished"
91
- user_project.validated #=> true
92
- user_project.current_team_id #=> 1434665
93
- user_project.cursus_ids #=> [1]
94
-
95
- user_project.project.id #=> 1
96
- user_project.project.name #=> "Libft"
97
- user_project.project.slug #=> "libft"
87
+ user_project.id #=> 405588
88
+ user_project.occurence #=> nil
89
+ user_project.final_mark #=> 115
90
+ user_project.status #=> "finished"
91
+ user_project.validated #=> true
92
+ user_project.current_team_id #=> 1434665
93
+ user_project.cursus_ids #=> [1]
94
+
95
+ user_project.project.id #=> 1
96
+ user_project.project.name #=> "Libft"
97
+ user_project.project.slug #=> "libft"
98
98
  end
99
99
 
100
100
  user.expertises_users.each do |expertise|
101
- expertise.id #=> 7696
102
- expertise.expertise_id #=> 29
103
- expertise.interested #=> true
104
- expertise.value #=> 2
105
- expertise.contact_me #=> false
106
- expertise.created_at #=> "2016-10-15T02:05:37.861Z"
107
- expertise.user_id #=> 19619
101
+ expertise.id #=> 7696
102
+ expertise.expertise_id #=> 29
103
+ expertise.interested #=> true
104
+ expertise.value #=> 2
105
+ expertise.contact_me #=> false
106
+ expertise.created_at #=> "2016-10-15T02:05:37.861Z"
107
+ expertise.user_id #=> 19619
108
108
  end
109
109
 
110
110
  user.achievements.each do |achievement|
111
- achievement.id #=> 41
112
- achievement.name #=> "In the name of Nicolas"
113
- achievement.description #=> "Etre logué 90h sur une semaine. (à bosser, comme Nicolas vous l'a conseillé !)"
114
- achievement.tier #=> "easy"
115
- achievement.kind #=> "scolarity"
116
- achievement.visible #=> true
117
- achievement.image #=> "/uploads/achievement/image/41/SCO001.svg"
118
- achievement.nbr_of_success #=> nil
119
- achievement.users_url #=> "https://api.intra.42.fr/v2/achievements/41/users"
111
+ achievement.id #=> 41
112
+ achievement.name #=> "In the name of Nicolas"
113
+ achievement.description #=> "Etre logué 90h sur une semaine. (à bosser, comme Nicolas vous l'a conseillé !)"
114
+ achievement.tier #=> "easy"
115
+ achievement.kind #=> "scolarity"
116
+ achievement.visible #=> true
117
+ achievement.image #=> "/uploads/achievement/image/41/SCO001.svg"
118
+ achievement.nbr_of_success #=> nil
119
+ achievement.users_url #=> "https://api.intra.42.fr/v2/achievements/41/users"
120
120
  end
121
121
 
122
122
  response = client.user_sessions("mfernand")
123
123
  user_sessions = response.user_sessions
124
124
 
125
125
  user_sessions.each do |session|
126
- session.id #=> 5017063
127
- session.begin_at #=> "2016-11-14T09:57:19"
128
- session.end_at #=> "2016-11-14T10:07:19"
129
- session.primary #-> true
130
- session.floor #=> nil
131
- session.row #=> nil
132
- session.post #=> nil
133
- session.host #=> "e1z2r7p18"
134
- session.campus_id #=> 7
126
+ session.id #=> 5017063
127
+ session.begin_at #=> "2016-11-14T09:57:19"
128
+ session.end_at #=> "2016-11-14T10:07:19"
129
+ session.primary #-> true
130
+ session.floor #=> nil
131
+ session.row #=> nil
132
+ session.post #=> nil
133
+ session.host #=> "e1z2r7p18"
134
+ session.campus_id #=> 7
135
135
  end
136
136
 
137
137
  ```
138
138
 
139
- That's it! You have access to all the info obtained from a User request to the 42 API.
139
+ ## Contribute to FortyTwo
140
+
141
+ There's lots of ways you can contribute. Hit me up on slack, fork it, play around with the implementation, or improve the docs.
@@ -13,7 +13,7 @@ module FortyTwo
13
13
  def initialize(json)
14
14
  super(json)
15
15
 
16
- @skills = parse(@cursus_users, Skill)
16
+ @skills = parse(@skills, Skill)
17
17
  @cursus = parse(@cursus, Cursus)
18
18
  end
19
19
  end
@@ -1,3 +1,3 @@
1
1
  module FortyTwo
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fortytwo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matias Fernandez