2 つのメソッドがありますが、1 つのメソッド タイトルdef suche(ins)
で何らかの理由でこのエラーが発生します。
syntax error, unexpected '(', expecting ';' or '\n'
def suche(ins)
私は初心者で、私が間違っていたことを本当に理解していません!. 誰かがこれで私を助けてくれることを願っています! どうもありがとう
私のコード全体:
class User
attr_accessor :username, :password, :uid, :private_key, :csr, :certificate
def initialize(username, password, uid, private_key=nil, csr=nil, certificate=nil)
@username = username
@password = password
@uid = uid
@private_key = "C:/Sites/keys/#{@username}private.pem"
@csr = "C:/Sites/keys/#{@username}csr.pem"
@certificate = certificate
end
def send(req,ww,text1=nil,text2=nil)
@conn = Faraday.new 'https://zombo.de/rest', :ssl => {:verify => false}
@conn.basic_auth(@username,@password)
@res = @conn.send(req) do |request|
request.url ww
request.headers['Content-Type'] = text1 unless text1 == nil
request.body = text2 unless text2 == nil
end
puts @res.body
end
def login
send('get',"login/#{@username}")
end
def change_password(newpass)
send('post',"accounts/#{@uid}/password",'text/plain',"#{newpass}")
def
def suche(ins)
send('get',"accounts/?search=#{ins}")
end
def send_csr
send('post','csr','text/plain',"#{File.read(@csr[0..-5])}")
end
def get_certificate
send('get',"accounts/#{@uid}/certificate")
end
end
user1 = User.new('john','AAasfsd','896242ß34ß')
user1.get_certificate