Class: SmartyStreets::Configuration
- Inherits:
-
Object
- Object
- SmartyStreets::Configuration
- Defined in:
- lib/smarty_streets/configuration.rb
Instance Attribute Summary collapse
-
#api_url ⇒ Object
API url for SmartyStreets.
-
#auth_id ⇒ Object
AUTH ID from SmartyStreets.
-
#auth_token ⇒ Object
AUTH TOKEN from SmartyStreets.
-
#number_of_candidates ⇒ Object
Number of candidates to provide when making a request.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#to_hash ⇒ Object
Returns a hash of all configurable options.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 18 |
# File 'lib/smarty_streets/configuration.rb', line 15 def initialize @api_url = 'api.smartystreets.com' @number_of_candidates = 1 end |
Instance Attribute Details
#api_url ⇒ Object
API url for SmartyStreets
4 5 6 |
# File 'lib/smarty_streets/configuration.rb', line 4 def api_url @api_url end |
#auth_id ⇒ Object
AUTH ID from SmartyStreets
7 8 9 |
# File 'lib/smarty_streets/configuration.rb', line 7 def auth_id @auth_id end |
#auth_token ⇒ Object
AUTH TOKEN from SmartyStreets
10 11 12 |
# File 'lib/smarty_streets/configuration.rb', line 10 def auth_token @auth_token end |
#number_of_candidates ⇒ Object
Number of candidates to provide when making a request.
13 14 15 |
# File 'lib/smarty_streets/configuration.rb', line 13 def number_of_candidates @number_of_candidates end |
Instance Method Details
#to_hash ⇒ Object
Returns a hash of all configurable options
21 22 23 24 25 |
# File 'lib/smarty_streets/configuration.rb', line 21 def to_hash OPTIONS.inject({}) do |hash, option| hash.merge(option.to_sym => send(option)) end end |