Class: Solr::Query::HttpRequestBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/solr/query/http_request_builder.rb

Constant Summary collapse

PATH =
'/select'.freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(query:, start:, rows:) ⇒ HttpRequestBuilder

Returns a new instance of HttpRequestBuilder.



14
15
16
17
18
# File 'lib/solr/query/http_request_builder.rb', line 14

def initialize(query:, start:, rows:)
  @query = query
  @rows = rows
  @start = start
end

Instance Attribute Details

#queryObject (readonly)

Returns the value of attribute query.



8
9
10
# File 'lib/solr/query/http_request_builder.rb', line 8

def query
  @query
end

#rowsObject (readonly)

Returns the value of attribute rows.



8
9
10
# File 'lib/solr/query/http_request_builder.rb', line 8

def rows
  @rows
end

#startObject (readonly)

Returns the value of attribute start.



8
9
10
# File 'lib/solr/query/http_request_builder.rb', line 8

def start
  @start
end

Class Method Details

.call(opts) ⇒ Object



10
11
12
# File 'lib/solr/query/http_request_builder.rb', line 10

def self.call(opts)
  new(**opts).call
end

Instance Method Details

#callObject



20
21
22
23
24
# File 'lib/solr/query/http_request_builder.rb', line 20

def call
  Solr::Request::HttpRequest.new(path: PATH,
                                 body: build_body,
                                 method: :post)
end