Class: Zerobounce::Configuration
- Inherits:
-
Object
- Object
- Zerobounce::Configuration
- Defined in:
- lib/zerobounce/configuration.rb
Overview
Configuration object for Zerobounce.
Instance Attribute Summary collapse
-
#apikey ⇒ String
A Zerobounce API key.
-
#headers ⇒ Hash
Headers to use in all requests.
-
#host ⇒ String
The Zerobounce API host.
-
#mock ⇒ Object
Returns the value of attribute mock.
-
#valid_statues ⇒ Array<Symbol>
The statuses that are considered valid by Response#valid?.
-
#valid_statuses ⇒ Object
Returns the value of attribute valid_statuses.
Instance Method Summary collapse
-
#initialize(mock = false) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(mock = false) ⇒ Configuration
Returns a new instance of Configuration.
28 29 30 31 32 33 34 |
# File 'lib/zerobounce/configuration.rb', line 28 def initialize(mock=false) self.host = 'https://api.zerobounce.net' self.apikey = ENV['ZEROBOUNCE_API_KEY'] self.valid_statuses = i[valid catch_all] self.headers = { user_agent: "ZerobounceRubyGem/#{Zerobounce::VERSION}" } self.mock = mock end |
Instance Attribute Details
#apikey ⇒ String
A Zerobounce API key.
21 22 23 |
# File 'lib/zerobounce/configuration.rb', line 21 def apikey @apikey end |
#headers ⇒ Hash
Headers to use in all requests.
21 22 23 |
# File 'lib/zerobounce/configuration.rb', line 21 def headers @headers end |
#host ⇒ String
The Zerobounce API host.
21 22 23 |
# File 'lib/zerobounce/configuration.rb', line 21 def host @host end |
#mock ⇒ Object
Returns the value of attribute mock.
26 27 28 |
# File 'lib/zerobounce/configuration.rb', line 26 def mock @mock end |
#valid_statues ⇒ Array<Symbol>
The statuses that are considered valid by Response#valid?.
21 22 23 |
# File 'lib/zerobounce/configuration.rb', line 21 def valid_statues @valid_statues end |
#valid_statuses ⇒ Object
Returns the value of attribute valid_statuses.
25 26 27 |
# File 'lib/zerobounce/configuration.rb', line 25 def valid_statuses @valid_statuses end |