lib/hoptoad-api.rb in hoptoad-api-2.1.0 vs lib/hoptoad-api.rb in hoptoad-api-2.2.0

- old
+ new

@@ -1,27 +1,21 @@ require 'hashie' require 'httparty' module Hoptoad extend self - attr_accessor :secure + attr_accessor :account, :auth_token, :secure class HoptoadError < StandardError; end - def account=(account) - @account = account + def configure(options={}) + @account = options[:account] if options.has_key?(:account) + @auth_token = options[:auth_token] if options.has_key?(:auth_token) + @secure = options[:secure] if options.has_key?(:secure) end - def account + def account_path "#{protocol}://#{@account}.hoptoadapp.com" - end - - def auth_token=(token) - @auth_token = token - end - - def auth_token - @auth_token end def protocol secure ? "https" : "http" end \ No newline at end of file