lib/hn/configuration.rb in hn_api-0.0.1 vs lib/hn/configuration.rb in hn_api-0.0.2
- old
+ new
@@ -1,26 +1,22 @@
require_relative 'version'
module HN
module Configuration
- VALID_CONFIGURATION_KEYS = [:api_version, :base_url, :api_url, :headers]
+ VALID_CONFIGURATION_KEYS = [:api_url, :headers]
attr_accessor *VALID_CONFIGURATION_KEYS
- DEFAULT_VERSION = 'v0'
- DEFAULT_BASE_URL = 'https://hacker-news.firebaseio.com'
- DEFAULT_API_URL = "#{DEFAULT_BASE_URL}/#{DEFAULT_VERSION}/"
+ DEFAULT_API_URL = 'https://hacker-news.firebaseio.com/v0/'
DEFAULT_HEADERS = { accept: 'application/json',
user_agent: "hn_api gem #{HN::Version}" }
def configure
yield self
end
def reset
- self.api_version = DEFAULT_VERSION
- self.base_url = DEFAULT_BASE_URL
self.api_url = DEFAULT_API_URL
self.headers = DEFAULT_HEADERS
self
end
end
\ No newline at end of file