module MercuryWebParser::Configuration
Constants
- DEFAULT_API_ENDPOINT
- DEFAULT_API_TOKEN
- DEFAULT_USER_AGENT
- VALID_CONFIG_KEYS
- VALID_CONNECTION_KEYS
- VALID_OPTIONS_KEYS
Public Class Methods
extended(base)
click to toggle source
# File lib/mercury_web_parser/configuration.rb, line 15 def self.extended(base) base.reset! end
Public Instance Methods
configure() { |self| ... }
click to toggle source
Convenience method to allow configuration options to be set in a block
# File lib/mercury_web_parser/configuration.rb, line 20 def configure yield self end
options()
click to toggle source
# File lib/mercury_web_parser/configuration.rb, line 24 def options Hash[* VALID_CONFIG_KEYS.map { |key| [key, send(key)] }.flatten] end
reset!()
click to toggle source
# File lib/mercury_web_parser/configuration.rb, line 28 def reset! self.api_endpoint = DEFAULT_API_ENDPOINT self.user_agent = DEFAULT_USER_AGENT self.api_token = DEFAULT_API_TOKEN true end