soullab 0.0.1 → 0.0.2

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: f60d9381f604f5a9cbd18e29c3d26cc9d8f8fc90
4
- data.tar.gz: 2571e9ce61440545b2b1cd21a6b6334f7ebe4375
3
+ metadata.gz: 08aa117a5244f9e69a4f11b21ac6abac7506d8fd
4
+ data.tar.gz: 783d22d16508e223bb800413c57ed2897f2ea60e
5
5
  SHA512:
6
- metadata.gz: bbe22ac7e876c359a0b39eabec622b8936f99eefe8580e6b8c39a362e725ae8739c6ae689664a636b2db5f272965c9d18d63f8e5bb8ce03f27ad5020e1ff2280
7
- data.tar.gz: 6e2c135e10008946ada5226875ba2138c867f4fa58bdf0ed8caa5e29a6c34fb245f5d015718f5915c7806f08f9670a1a5e62198e49e16bf7e619e5fecc3fe826
6
+ metadata.gz: 9baf673f1b52ad24bb9f659944f9d3f0ed568f88bbf15f60779436edfaaf0481588057a79976ca5de6253e3e1a1b8f4348fbad266fcaa34f4948ff29112e094f
7
+ data.tar.gz: 7c6855675d8e7a986dd805c2cbf0113a4120a35123d8e7c3c9937f26631f4b45a8b254733ec462eadf1ba99a7f44f9f54118a1644e3eabd84cd24b8cf2b3f844
@@ -0,0 +1,10 @@
1
+ class CampoInvalido < StandardError
2
+
3
+ attr_accessor :campo,:motivo
4
+
5
+ def initialize(campo, motivo)
6
+ @campo = campo
7
+ @motivo = motivo
8
+ end
9
+
10
+ end
data/lib/soullab.rb CHANGED
@@ -4,6 +4,7 @@ require 'date'
4
4
  require 'digest/sha1'
5
5
  require 'openssl'
6
6
  require 'base64'
7
+ require 'exceptions/campoInvalido'
7
8
 
8
9
  class Soullab
9
10
 
@@ -159,18 +160,25 @@ class Soullab
159
160
  :accept => :json
160
161
  )
161
162
 
163
+ wsreturn = JSON.parse(response.body)
164
+
165
+ begin
166
+ raise CampoInvalido.new("login","Este parâmetro deve ser alfanumérico") if wsreturn['message'] == "23"
167
+ rescue CampoInvalido => e
168
+ puts "campo: #{e.campo}"
169
+ puts "motivo: #{e.motivo}"
170
+ end
171
+
162
172
  return JSON.parse(response.body)
163
173
  end
164
174
 
165
- def integrarTurma(codigoEscola, codigo, anoTurma, periodoAno, professor, dataInicio, dataFim, avisos)
175
+ def integrarTurma(codigoEscola, codigo, professor, dataInicio, dataFim, avisos)
166
176
 
167
177
  puts "Generating json..." if $DEBUG
168
178
 
169
179
  turma = {
170
180
  codigoEscola: codigoEscola,
171
181
  codigo: codigo,
172
- anoTurma: anoTurma,
173
- periodoAno: periodoAno,
174
182
  professor: professor,
175
183
  dataInicio: dataInicio,
176
184
  dataFim: dataFim,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soullab
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Augusto Russo
@@ -52,13 +52,14 @@ dependencies:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
54
  version: 3.2.4
55
- description: 'Want to integrate your system with soullab? No problem! This gem provides
56
- all you need. Know more about soullab at: www.soullab.com.br'
55
+ description: 'Want to integrate your system with soullab? This gem provides all you
56
+ need. Know more about soullab at: www.soullab.com.br'
57
57
  email: augusto.russo@inovaz.com.br
58
58
  executables: []
59
59
  extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
+ - lib/exceptions/campoInvalido.rb
62
63
  - lib/soullab.rb
63
64
  homepage: http://www.soullab.com.br
64
65
  licenses: