Class: Qa::LinkedData::ResponseHeaderService
- Inherits:
-
Object
- Object
- Qa::LinkedData::ResponseHeaderService
- Defined in:
- app/services/qa/linked_data/response_header_service.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#graph ⇒ Object
readonly
Returns the value of attribute graph.
-
#request_header ⇒ Object
readonly
Returns the value of attribute request_header.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
-
#fetch_header ⇒ Object
Construct response header to pass back with fetch results (linked data module).
-
#initialize(request_header:, results:, config:, graph:) ⇒ ResponseHeaderService
constructor
A new instance of ResponseHeaderService.
-
#search_header ⇒ Object
Construct response header to pass back with search results (linked data module).
Constructor Details
#initialize(request_header:, results:, config:, graph:) ⇒ ResponseHeaderService
Returns a new instance of ResponseHeaderService.
14 15 16 17 18 19 |
# File 'app/services/qa/linked_data/response_header_service.rb', line 14 def initialize(request_header:, results:, config:, graph:) @request_header = request_header @results = results @config = config @graph = graph end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'app/services/qa/linked_data/response_header_service.rb', line 8 def config @config end |
#graph ⇒ Object (readonly)
Returns the value of attribute graph.
8 9 10 |
# File 'app/services/qa/linked_data/response_header_service.rb', line 8 def graph @graph end |
#request_header ⇒ Object (readonly)
Returns the value of attribute request_header.
8 9 10 |
# File 'app/services/qa/linked_data/response_header_service.rb', line 8 def request_header @request_header end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
8 9 10 |
# File 'app/services/qa/linked_data/response_header_service.rb', line 8 def results @results end |
Instance Method Details
#fetch_header ⇒ Object
Construct response header to pass back with fetch results (linked data module).
36 37 38 39 40 |
# File 'app/services/qa/linked_data/response_header_service.rb', line 36 def fetch_header header = {} header[:predicate_count] = pred_count header end |
#search_header ⇒ Object
Construct response header to pass back with search results (linked data module).
24 25 26 27 28 29 30 31 |
# File 'app/services/qa/linked_data/response_header_service.rb', line 24 def search_header header = {} header[:start_record] = start_record header[:requested_records] = requested_records header[:retrieved_records] = retrieved_records header[:total_records] = total_record_count header end |