lib/yubico.rb
def last_response
      hash = @_res.scan(/h=([\w_\=\/]+)[\s]/).first
	    timestamp = @_res.scan(/t=([\w\-:]+)[\s]/).first
	    status = @_res.scan(/status=([a-zA-Z0-9_]+)[\s]/).first
	    info = @_res.scan(/info=([\w\t\S\W]+)/).first
	  
	    return { "h" => hash, "t" => timestamp, "status" => status, "info" => info }
    end
# Return the last available Yubikey response body, in full, for parsing.
#   req = yk.verify( @token, @_id )
#   res = req.last_response
#     # => "h=...\nstatus=OK"
#
# On an error, there will be many fields returned by this function you can sift out manually
# using regular expressions (to be implemented: last_response returns an associative array of the
# response.) for various variables.
#   req = yk.verify( @token, @_id )
#     # => "h=Z/D42NucC1nSlIVZqFPR3RO5dG4=\r\nt=2007-10-23T14:26:48Z\r\nstatus=REPLAYED_OTP\r\n\r\n"
#   res = yk.last_response
#   res["h"]
#     # => "h=Z/D42NucC1nSlIVZqFPR3RO5dG4="
#   res["t"]
#     # => "2007-10-23T14:26:48Z"
#   res["status"]
#     # => "REPLAYED_OTP"
#   res["info"]
#     # => nil
#
Return the last available Yubikey response body, in full, for parsing.

On an error, there will be many fields returned by this function you can sift out manually
using regular expressions (to be implemented: last_response returns an associative array of the
response.) for various variables.
Return the last available Yubikey response body in full for parsing . On an error there will be many fields returned by this function you can sift out manually using regular expressions ( to be implemented : last_response returns an associative array of the response . ) for various variables .
def last_response
      hash = @_res.scan(/h=([\w_\=\/]+)[\s]/).first
	    timestamp = @_res.scan(/t=([\w\-:]+)[\s]/).first
	    status = @_res.scan(/status=([a-zA-Z0-9_]+)[\s]/).first
	    info = @_res.scan(/info=([\w\t\S\W]+)/).first
	    return { "h" => hash, "t" => timestamp, "status" => status, "info" => info }
    end
def last_response hash = @_res . scan ( / h=([ \w _ \= \/ ]+)[ \s ] / ) . first timestamp = @_res . scan ( / t=([ \w \- :]+)[ \s ] / ) . first status = @_res . scan ( / status=([a-zA-Z0-9_]+)[ \s ] / ) . first info = @_res . scan ( / info=([ \w \t \S \W ]+) / ) . first return { "h" => hash , "t" => timestamp , "status" => status , "info" => info } end
Return the last available Yubikey response body, in full, for parsing.
Return the last available Yubikey response body in full for parsing .