lib/hackernews_ruby/client.rb in hackernews_ruby-0.0.2 vs lib/hackernews_ruby/client.rb in hackernews_ruby-0.0.3

- old
+ new

@@ -8,12 +8,14 @@ include Request attr_accessor :api_url, :api_version def initialize(options={}) - @api_url = options[:api_url].nil? ? HackernewsRuby.api_url : options[:api_url] - @api_version = options[:api_version].nil? ? HackernewsRuby.api_version : options[:api_version] + @api_url = "https://hacker-news.firebaseio.com" + @api_version = "v0" + @api_url = options[:api_url].nil? ? api_url : options[:api_url] + @api_version = options[:api_version].nil? ? @api_version : options[:api_version] reload_config end def connection @@ -53,10 +55,10 @@ user_agent: "Ruby Gem vy HackerNews_Ruby #{HackernewsRuby::VERSION}" } end def reload_config - HackernewsRuby.api_url = api_url - HackernewsRuby.api_version = api_version + HackernewsRuby.api_url = @api_url + HackernewsRuby.api_version = @api_version end end end