Class: CrescaBrasilApi::Passport

Inherits:
Object
  • Object
show all
Defined in:
lib/cresca_brasil_api/passport.rb

Instance Method Summary collapse

Constructor Details

#initializePassport

Returns a new instance of Passport.



3
4
5
# File 'lib/cresca_brasil_api/passport.rb', line 3

def initialize
  @connection = CrescaBrasilApi::Connection.new
end

Instance Method Details

#cancelObject



22
23
24
25
# File 'lib/cresca_brasil_api/passport.rb', line 22

def cancel
  xml = "<passaporte><serie>#{passport_serie}</serie></passaporte>"
  @connection.request("passaporte", :cancelar_passaporte, version, xml)
end

#confirm_receive(version, passport_serie) ⇒ Object



17
18
19
20
# File 'lib/cresca_brasil_api/passport.rb', line 17

def confirm_receive(version, passport_serie)
  xml = "<passaporte><serie>#{passport_serie}</serie></passaporte>"
  @connection.request("passaporte", :confirmar_passaporte, version, xml)
end

#generate(version, type_passport) ⇒ Object



7
8
9
10
# File 'lib/cresca_brasil_api/passport.rb', line 7

def generate(version, type_passport)
  xml = "<passaporte><codigo_tipo>#{type_passport}</codigo_tipo><cliente></cliente></passaporte>"
  @connection.request("passaporte", :gerar_passaporte, version, xml)
end

#generate_associated_course(version, type_passport, course_id) ⇒ Object



12
13
14
15
# File 'lib/cresca_brasil_api/passport.rb', line 12

def generate_associated_course(version, type_passport, course_id)
  xml = "<passaporte><codigo_tipo>#{type_passport}</codigo_tipo><codigo_curso>#{course_id}</codigo_curso><cliente></cliente></passaporte>"
  @connection.request("passaporte", :gerar_passaporte_vinculado_ao_curso, version, xml)
end