Module: Pipl::Configurable
Constant Summary collapse
- SHOW_SOURCES_ALL =
'all'
- SHOW_SOURCES_MATCHING =
'matching'
- SHOW_SOURCES_NONE =
'false'
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.
-
#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
permalink #api_endpoint ⇒ Object
47 48 49 |
# File 'lib/pipl/configurable.rb', line 47 def api_endpoint File.join(@api_endpoint, '') end |
permalink #api_key ⇒ Object
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/pipl/configurable.rb', line 9 def api_key @api_key end |
permalink #hide_sponsored ⇒ Object
Returns the value of attribute hide_sponsored.
9 10 11 |
# File 'lib/pipl/configurable.rb', line 9 def hide_sponsored @hide_sponsored end |
permalink #infer_persons ⇒ Object
Returns the value of attribute infer_persons.
10 11 12 |
# File 'lib/pipl/configurable.rb', line 10 def infer_persons @infer_persons end |
permalink #live_feeds ⇒ Object
Returns the value of attribute live_feeds.
9 10 11 |
# File 'lib/pipl/configurable.rb', line 9 def live_feeds @live_feeds end |
permalink #match_requirements ⇒ Object
Returns the value of attribute match_requirements.
10 11 12 |
# File 'lib/pipl/configurable.rb', line 10 def match_requirements @match_requirements end |
permalink #minimum_match ⇒ Object
Returns the value of attribute minimum_match.
9 10 11 |
# File 'lib/pipl/configurable.rb', line 9 def minimum_match @minimum_match end |
permalink #minimum_probability ⇒ Object
Returns the value of attribute minimum_probability.
9 10 11 |
# File 'lib/pipl/configurable.rb', line 9 def minimum_probability @minimum_probability end |
permalink #show_sources ⇒ Object
Returns the value of attribute show_sources.
9 10 11 |
# File 'lib/pipl/configurable.rb', line 9 def show_sources @show_sources end |
permalink #source_category_requirements ⇒ Object
Returns the value of attribute source_category_requirements.
10 11 12 |
# File 'lib/pipl/configurable.rb', line 10 def source_category_requirements @source_category_requirements end |
permalink #strict_validation ⇒ Object
Returns the value of attribute strict_validation.
10 11 12 |
# File 'lib/pipl/configurable.rb', line 10 def strict_validation @strict_validation end |
permalink #user_agent ⇒ Object
Returns the value of attribute user_agent.
10 11 12 |
# File 'lib/pipl/configurable.rb', line 10 def user_agent @user_agent end |
Class Method Details
permalink .keys ⇒ Object
[View source]
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/pipl/configurable.rb', line 15 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 ] end |
Instance Method Details
permalink #configure {|_self| ... } ⇒ Object
34 35 36 |
# File 'lib/pipl/configurable.rb', line 34 def configure yield self end |
permalink #reset! ⇒ Object Also known as: setup
[View source]
38 39 40 41 42 43 |
# File 'lib/pipl/configurable.rb', line 38 def reset! Pipl::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", Pipl::Default.[key]) end self end |