Hello. I can not print variable that is inside a def.
Script
class LogParser
def initialize (ip, data, code)
log = File.open("/project/log_sec/log/log.txt").each do |file|
parse = file.split(" ")
data = parse[0]
time = parse[1]
@ip = parse[2]
method = parse[3]
url = parse[4]
code = parse[5]
ref = parse[8]
useragent = parse[9]
end
end
def displayparse ()
puts "IP #@ip"
end
The @IP puts nothing appears