Class: TransparenciaAlagoas::Bidding

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

Class Method Summary collapse

Class Method Details

.get(qty: 10, offset: 0, options: {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/models/bidding.rb', line 3

def self.get(qty: 10, offset: 0, options: {})
	# Return biddings
   url = "/licitacao/json-editais/?limit=#{qty}&offset=#{offset}"
   if options != nil
   	if options.key? :start_date
   		url += "&data_realizacao_dti_=#{options[:start_date]}"
   		options.delete(:start_date)
   	end

   	if options.key? :end_date
   		url += "&data_realizacao_dtf_=#{options[:end_date]}"
   		options.delete(:end_date)
   	end
   end 

   TransparenciaAlagoas::dispatch_get_request(url)	
end