Class: UrlProcessor::Config
- Inherits:
-
Object
- Object
- UrlProcessor::Config
- Defined in:
- lib/url_processor/config.rb
Instance Attribute Summary collapse
-
#batch_size ⇒ Object
configuration parameters.
-
#cookies_file ⇒ Object
Returns the value of attribute cookies_file.
-
#debug ⇒ Object
debugging.
-
#get_link_by_id ⇒ Object
readonly
get individual link.
-
#links ⇒ Object
readonly
get all links.
-
#logger ⇒ Object
readonly
logging.
-
#max_concurrency ⇒ Object
Returns the value of attribute max_concurrency.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#max_timeout ⇒ Object
Returns the value of attribute max_timeout.
-
#max_total_connections ⇒ Object
Returns the value of attribute max_total_connections.
-
#new_link_request ⇒ Object
readonly
create new link request.
-
#process_response ⇒ Object
readonly
process responses.
Instance Method Summary collapse
- #creates_new_link_request_with(&block) ⇒ Object
- #log=(logging_location) ⇒ Object
- #processes_response_with(&block) ⇒ Object
- #retrieves_all_links_with(&block) ⇒ Object
- #retrieves_links_by_id_with(&block) ⇒ Object
- #validate! ⇒ Object
Instance Attribute Details
#batch_size ⇒ Object
configuration parameters
5 6 7 |
# File 'lib/url_processor/config.rb', line 5 def batch_size @batch_size end |
#cookies_file ⇒ Object
Returns the value of attribute cookies_file.
8 9 10 |
# File 'lib/url_processor/config.rb', line 8 def @cookies_file end |
#debug ⇒ Object
debugging
13 14 15 |
# File 'lib/url_processor/config.rb', line 13 def debug @debug end |
#get_link_by_id ⇒ Object (readonly)
get individual link
28 29 30 |
# File 'lib/url_processor/config.rb', line 28 def get_link_by_id @get_link_by_id end |
#links ⇒ Object (readonly)
get all links
34 35 36 |
# File 'lib/url_processor/config.rb', line 34 def links @links end |
#logger ⇒ Object (readonly)
logging
20 21 22 |
# File 'lib/url_processor/config.rb', line 20 def logger @logger end |
#max_concurrency ⇒ Object
Returns the value of attribute max_concurrency.
6 7 8 |
# File 'lib/url_processor/config.rb', line 6 def max_concurrency @max_concurrency end |
#max_retries ⇒ Object
Returns the value of attribute max_retries.
7 8 9 |
# File 'lib/url_processor/config.rb', line 7 def max_retries @max_retries end |
#max_timeout ⇒ Object
Returns the value of attribute max_timeout.
10 11 12 |
# File 'lib/url_processor/config.rb', line 10 def max_timeout @max_timeout end |
#max_total_connections ⇒ Object
Returns the value of attribute max_total_connections.
9 10 11 |
# File 'lib/url_processor/config.rb', line 9 def max_total_connections @max_total_connections end |
#new_link_request ⇒ Object (readonly)
create new link request
40 41 42 |
# File 'lib/url_processor/config.rb', line 40 def new_link_request @new_link_request end |
#process_response ⇒ Object (readonly)
process responses
46 47 48 |
# File 'lib/url_processor/config.rb', line 46 def process_response @process_response end |
Instance Method Details
#creates_new_link_request_with(&block) ⇒ Object
41 42 43 |
# File 'lib/url_processor/config.rb', line 41 def creates_new_link_request_with(&block) @new_link_request = block end |
#log=(logging_location) ⇒ Object
22 23 24 25 |
# File 'lib/url_processor/config.rb', line 22 def log=(logging_location) @logger = Logger.new(logging_location) update_logging_level end |
#processes_response_with(&block) ⇒ Object
47 48 49 |
# File 'lib/url_processor/config.rb', line 47 def processes_response_with(&block) @process_response = block end |
#retrieves_all_links_with(&block) ⇒ Object
35 36 37 |
# File 'lib/url_processor/config.rb', line 35 def retrieves_all_links_with(&block) @links = block end |
#retrieves_links_by_id_with(&block) ⇒ Object
29 30 31 |
# File 'lib/url_processor/config.rb', line 29 def retrieves_links_by_id_with(&block) @get_link_by_id = block end |
#validate! ⇒ Object
51 52 53 54 55 56 |
# File 'lib/url_processor/config.rb', line 51 def validate! raise NotImplementedError.new("retrieves_links_by_id_with not set") if get_link_by_id.nil? raise NotImplementedError.new("retrieves_all_links_with not set") if links.nil? raise NotImplementedError.new("creates_new_link_request_with not set") if new_link_request.nil? raise NotImplementedError.new("processes_response_with not set") if process_response.nil? end |