lib/insales_api/app.rb in insales_api-0.0.10 vs lib/insales_api/app.rb in insales_api-0.0.13
- old
+ new
@@ -1,19 +1,19 @@
-require 'digest/md5'
module InsalesApi
class App
- cattr_accessor :api_key, :api_host, :api_secret, :api_autologin_path
+ class_attribute :api_key, :api_host, :api_secret, :api_autologin_path
attr_reader :authorized, :auth_token, :shop, :password
def initialize(shop, password)
@authorized = false
@shop = self.class.prepare_shop shop
@password = password
end
def authorization_url
store_auth_token
- "http://#{shop}/admin/applications/#{self.class.api_key}/login?token=#{salt}&login=http://#{self.class.api_host}/#{self.class.api_autologin_path}"
+ "http://#{shop}/admin/applications/#{self.class.api_key}/login?" \
+ "token=#{salt}&login=http://#{self.class.api_host}/#{self.class.api_autologin_path}"
end
def store_auth_token
@auth_token ||= InsalesApi::Password.create(password, salt)
end