Class: Verity::Resources::Coverage

Inherits:
Object
  • Object
show all
Defined in:
lib/verity/resources/coverage.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Coverage

Returns a new instance of Coverage.



6
7
8
# File 'lib/verity/resources/coverage.rb', line 6

def initialize(client)
  @client = client
end

Instance Method Details

#evaluate(policy_id:, parameters:) ⇒ Object



25
26
27
# File 'lib/verity/resources/coverage.rb', line 25

def evaluate(policy_id:, parameters:)
  @client.request(:post, '/coverage/evaluate', body: { policy_id: policy_id, parameters: parameters })
end

#jurisdictionsObject



21
22
23
# File 'lib/verity/resources/coverage.rb', line 21

def jurisdictions
  @client.request(:get, '/jurisdictions')
end

#search_criteria(q, section: nil, policy_type: nil, jurisdiction: nil, cursor: nil, limit: 50) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/verity/resources/coverage.rb', line 10

def search_criteria(q, section: nil, policy_type: nil, jurisdiction: nil, cursor: nil, limit: 50)
  params = { q: q }
  params[:section] = section if section
  params[:policy_type] = policy_type if policy_type
  params[:jurisdiction] = jurisdiction if jurisdiction
  params[:cursor] = cursor if cursor
  params[:limit] = limit if limit

  @client.request(:get, '/coverage/criteria', params: params)
end