piplapis-ruby 5.0.1 → 5.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -107,6 +107,10 @@ module Pipl
107
107
  raise ArgumentError.new('match_requirements must be a String')
108
108
  end
109
109
 
110
+ if opts[:source_category_requirements] and not opts[:source_category_requirements].is_a? String
111
+ raise ArgumentError.new('source_category_requirements must be a String')
112
+ end
113
+
110
114
  unless opts.key? :search_pointer
111
115
  unsearchable = opts[:person].unsearchable_fields
112
116
  if unsearchable and not unsearchable.empty?
@@ -118,7 +122,7 @@ module Pipl
118
122
 
119
123
  def create_http_request(opts)
120
124
  uri = URI(opts[:api_endpoint])
121
- keys = %w(minimum_probability minimum_match hide_sponsored live_feeds show_sources match_requirements)
125
+ keys = %w(minimum_probability minimum_match hide_sponsored live_feeds show_sources match_requirements source_category_requirements)
122
126
  query_params = ["key=#{opts[:api_key]}"] + keys.map { |k| "#{k}=#{opts[k.to_sym]}" unless opts[k.to_sym].nil? }
123
127
  query_params << opts[:extra] or []
124
128
  query_params << uri.query
@@ -7,7 +7,7 @@ module Pipl
7
7
  SHOW_SOURCES_NONE = 'false'
8
8
 
9
9
  attr_accessor :api_key, :minimum_probability, :minimum_match, :hide_sponsored, :live_feeds, :show_sources
10
- attr_accessor :match_requirements, :strict_validation, :user_agent
10
+ attr_accessor :match_requirements, :source_category_requirements, :strict_validation, :user_agent
11
11
  attr_writer :api_endpoint
12
12
 
13
13
  class << self
@@ -21,6 +21,7 @@ module Pipl
21
21
  :live_feeds,
22
22
  :show_sources,
23
23
  :match_requirements,
24
+ :source_category_requirements,
24
25
  :strict_validation,
25
26
  :api_endpoint,
26
27
  :user_agent
@@ -42,6 +42,10 @@ module Pipl
42
42
  ENV['PIPL_MATCH_REQUIREMENTS']
43
43
  end
44
44
 
45
+ def source_category_requirements
46
+ ENV['PIPL_SOURCE_CATEGORY_REQUIREMENTS']
47
+ end
48
+
45
49
  def strict_validation
46
50
  ENV['PIPL_USER_STRICT_VALIDATION']
47
51
  end
@@ -9,7 +9,8 @@ module Pipl
9
9
  class SearchResponse
10
10
 
11
11
  attr_reader :query, :person, :sources, :possible_persons, :warnings, :visible_sources, :available_sources
12
- attr_reader :search_id, :http_status_code, :raw_response, :available_data
12
+ attr_reader :search_id, :http_status_code, :raw_response, :available_data, :match_requirements
13
+ attr_reader :source_category_requirements
13
14
 
14
15
  def initialize(params={})
15
16
  @query = params[:query]
@@ -23,6 +24,8 @@ module Pipl
23
24
  @http_status_code = params[:http_status_code]
24
25
  @raw_response = params[:raw_response]
25
26
  @available_data = params[:available_data]
27
+ @match_requirements = params[:match_requirements]
28
+ @source_category_requirements = params[:source_category_requirements]
26
29
  end
27
30
 
28
31
  def self.from_json(json_str)
@@ -39,6 +42,8 @@ module Pipl
39
42
  params[:search_id] = h[:@search_id]
40
43
  params[:http_status_code] = h[:@http_status_code]
41
44
  params[:raw_response] = json_str
45
+ params[:match_requirements] = h[:match_requirements]
46
+ params[:source_category_requirements] = h[:source_category_requirements]
42
47
  params[:available_data] = AvailableData.from_hash(h[:available_data]) if h.key? :available_data
43
48
 
44
49
  self.new(params)
@@ -1,3 +1,3 @@
1
1
  module Pipl
2
- VERSION = '5.0.1'.freeze
2
+ VERSION = '5.0.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piplapis-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-16 00:00:00.000000000 Z
12
+ date: 2016-03-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler