lib/hoptoad-api.rb in hoptoad-api-2.0.0 vs lib/hoptoad-api.rb in hoptoad-api-2.0.1
- old
+ new
@@ -1,27 +1,33 @@
require 'hashie'
require 'httparty'
module Hoptoad
extend self
+ attr_accessor :secure
class HoptoadError < StandardError; end
def account=(account)
@account = account
end
def account
- "http://#{@account}.hoptoadapp.com"
+ "#{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
+
end
require 'hoptoad-api/version'
require 'hoptoad-api/core_extensions'
require 'hoptoad-api/client'
\ No newline at end of file