Class: TransparenciaAlagoas::Servant

Inherits:
Object
  • Object
show all
Defined in:
lib/models/servant.rb

Class Method Summary collapse

Class Method Details

.active_servants(qty: 10, offset: 0, month: nil, year: nil, options: {}) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/models/servant.rb', line 5

def self.active_servants(qty: 10, offset: 0, month: nil, year: nil, options: {})
	# Return the list of active public servants of Alagoas Government
month = month != nil ? month : Date.today.strftime("%m")
year = year != nil ? year : Date.today.strftime("%Y")

	url = "/pessoal/json-servidores/?limit=#{qty}&offset=#{offset}&mes=#{month}&ano=#{year}"    

  TransparenciaAlagoas::dispatch_get_request(url, options)
end

.detail_active_servant(qty: 10, offset: 0, servant_id: nil, options: {}) ⇒ Object



15
16
17
18
19
# File 'lib/models/servant.rb', line 15

def self.detail_active_servant(qty: 10, offset: 0, servant_id: nil, options: {})
	# Return the details of active public servant
	url = "/pessoal/json-perfil-servidor/#{servant_id}/?limit=#{qty}&offset=#{offset}"
  TransparenciaAlagoas::dispatch_get_request(url, options)
end

.detail_inactive_servant(qty: 10, offset: 0, servant_id: nil, options: {}) ⇒ Object



31
32
33
34
35
# File 'lib/models/servant.rb', line 31

def self.detail_inactive_servant(qty: 10, offset: 0, servant_id: nil, options: {})
	# Return the details of active public servant
	url = "/pessoal/json-perfil-servidor-inativo/#{servant_id}/?limit=#{qty}&offset=#{offset}"
  TransparenciaAlagoas::dispatch_get_request(url, options)
end

.inactive_servants(qty: 10, offset: 0, month: nil, year: nil, options: {}) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/models/servant.rb', line 21

def self.inactive_servants(qty: 10, offset: 0, month: nil, year: nil, options: {})
	# Return the list of active public servants of Alagoas Government
month = month != nil ? month : Date.today.strftime("%m")
year = year != nil ? year : Date.today.strftime("%Y")

	url = "/pessoal/json-servidores-inativos/?limit=#{qty}&offset=#{offset}&mes=#{month}&ano=#{year}"    

  TransparenciaAlagoas::dispatch_get_request(url, options)
end