Class: LCBO::CrawlKit::RequestPrototype

Inherits:
Object
  • Object
show all
Defined in:
lib/lcbo/crawlkit/request_prototype.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri_template = nil, http_method = :get, body_params = {}) ⇒ RequestPrototype

Returns a new instance of RequestPrototype.



7
8
9
10
11
# File 'lib/lcbo/crawlkit/request_prototype.rb', line 7

def initialize(uri_template = nil, http_method = :get, body_params = {})
  self.uri_template = uri_template
  self.http_method  = http_method
  self.body_params  = body_params
end

Instance Attribute Details

#body_paramsObject

Returns the value of attribute body_params.



5
6
7
# File 'lib/lcbo/crawlkit/request_prototype.rb', line 5

def body_params
  @body_params
end

#http_methodObject

Returns the value of attribute http_method.



5
6
7
# File 'lib/lcbo/crawlkit/request_prototype.rb', line 5

def http_method
  @http_method
end

#uri_templateObject

Returns the value of attribute uri_template.



5
6
7
# File 'lib/lcbo/crawlkit/request_prototype.rb', line 5

def uri_template
  @uri_template
end

Instance Method Details

#request(query_params = {}, body_params = {}) ⇒ Object



25
26
27
# File 'lib/lcbo/crawlkit/request_prototype.rb', line 25

def request(query_params = {}, body_params = {})
  Request.new(self, query_params, body_params).run
end