Class: CrescaBrasilApi::Course
- Inherits:
-
Object
- Object
- CrescaBrasilApi::Course
- Defined in:
- lib/cresca_brasil_api/course.rb
Instance Method Summary collapse
- #get_all_category(version, language = "pt-BR") ⇒ Object
- #get_all_course(version, category = 0) ⇒ Object
- #get_all_course_for_rescue(version, category = 0) ⇒ Object
-
#initialize ⇒ Course
constructor
A new instance of Course.
Constructor Details
#initialize ⇒ Course
Returns a new instance of Course.
3 4 5 |
# File 'lib/cresca_brasil_api/course.rb', line 3 def initialize @connection = CrescaBrasilApi::Connection.new end |
Instance Method Details
#get_all_category(version, language = "pt-BR") ⇒ Object
17 18 19 20 |
# File 'lib/cresca_brasil_api/course.rb', line 17 def get_all_category(version, language = "pt-BR") xml = "<categoria><idioma>#{language}</idioma></categoria>" @connection.request("curso", :consultar_categorias, version, xml) end |
#get_all_course(version, category = 0) ⇒ Object
7 8 9 10 |
# File 'lib/cresca_brasil_api/course.rb', line 7 def get_all_course(version, category = 0) xml = "<curso><id_categoria>#{category}</id_categoria></curso>" @connection.request("curso", :consultar_cursos_online, version, xml) end |
#get_all_course_for_rescue(version, category = 0) ⇒ Object
12 13 14 15 |
# File 'lib/cresca_brasil_api/course.rb', line 12 def get_all_course_for_rescue(version, category = 0) xml = "<curso><id_categoria>#{category}</id_categoria></curso>" @connection.request("curso", :consultar_cursos_resgate, version, xml) end |