Module: Pipl::Configurable
Constant Summary collapse
- SHOW_SOURCES_ALL =
'all'
- SHOW_SOURCES_MATCHING =
'matching'
- SHOW_SOURCES_NONE =
'false'
- DEFAULT_API_VERSION =
5
Instance Attribute Summary collapse
- #api_endpoint ⇒ Object
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#hide_sponsored ⇒ Object
Returns the value of attribute hide_sponsored.
-
#infer_persons ⇒ Object
Returns the value of attribute infer_persons.
-
#live_feeds ⇒ Object
Returns the value of attribute live_feeds.
-
#match_requirements ⇒ Object
Returns the value of attribute match_requirements.
-
#minimum_match ⇒ Object
Returns the value of attribute minimum_match.
-
#minimum_probability ⇒ Object
Returns the value of attribute minimum_probability.
-
#show_sources ⇒ Object
Returns the value of attribute show_sources.
-
#source_category_requirements ⇒ Object
Returns the value of attribute source_category_requirements.
-
#strict_validation ⇒ Object
Returns the value of attribute strict_validation.
-
#top_match ⇒ Object
Returns the value of attribute top_match.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Class Method Summary collapse
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
- #reset! ⇒ Object (also: #setup)
Instance Attribute Details
#api_endpoint ⇒ Object
50 51 52 |
# File 'lib/pipl/configurable.rb', line 50 def api_endpoint File.join(@api_endpoint, '') end |
#api_key ⇒ Object
Returns the value of attribute api_key.
10 11 12 |
# File 'lib/pipl/configurable.rb', line 10 def api_key @api_key end |
#hide_sponsored ⇒ Object
Returns the value of attribute hide_sponsored.
10 11 12 |
# File 'lib/pipl/configurable.rb', line 10 def hide_sponsored @hide_sponsored end |
#infer_persons ⇒ Object
Returns the value of attribute infer_persons.
11 12 13 |
# File 'lib/pipl/configurable.rb', line 11 def infer_persons @infer_persons end |
#live_feeds ⇒ Object
Returns the value of attribute live_feeds.
10 11 12 |
# File 'lib/pipl/configurable.rb', line 10 def live_feeds @live_feeds end |
#match_requirements ⇒ Object
Returns the value of attribute match_requirements.
11 12 13 |
# File 'lib/pipl/configurable.rb', line 11 def match_requirements @match_requirements end |
#minimum_match ⇒ Object
Returns the value of attribute minimum_match.
10 11 12 |
# File 'lib/pipl/configurable.rb', line 10 def minimum_match @minimum_match end |
#minimum_probability ⇒ Object
Returns the value of attribute minimum_probability.
10 11 12 |
# File 'lib/pipl/configurable.rb', line 10 def minimum_probability @minimum_probability end |
#show_sources ⇒ Object
Returns the value of attribute show_sources.
10 11 12 |
# File 'lib/pipl/configurable.rb', line 10 def show_sources @show_sources end |
#source_category_requirements ⇒ Object
Returns the value of attribute source_category_requirements.
11 12 13 |
# File 'lib/pipl/configurable.rb', line 11 def source_category_requirements @source_category_requirements end |
#strict_validation ⇒ Object
Returns the value of attribute strict_validation.
11 12 13 |
# File 'lib/pipl/configurable.rb', line 11 def strict_validation @strict_validation end |
#top_match ⇒ Object
Returns the value of attribute top_match.
12 13 14 |
# File 'lib/pipl/configurable.rb', line 12 def top_match @top_match end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
11 12 13 |
# File 'lib/pipl/configurable.rb', line 11 def user_agent @user_agent end |
Class Method Details
.keys ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/pipl/configurable.rb', line 17 def keys @keys ||= [ :api_key, :minimum_probability, :minimum_match, :hide_sponsored, :live_feeds, :show_sources, :match_requirements, :source_category_requirements, :infer_persons, :strict_validation, :api_endpoint, :user_agent, :top_match ] end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
37 38 39 |
# File 'lib/pipl/configurable.rb', line 37 def configure yield self end |
#reset! ⇒ Object Also known as: setup
41 42 43 44 45 46 |
# File 'lib/pipl/configurable.rb', line 41 def reset! Pipl::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Pipl::Default.[key]) end self end |