From 80958380cbb7a492d0ef7586714f2cfe8885603b Mon Sep 17 00:00:00 2001 From: Azul Date: Mon, 25 Feb 2013 15:33:48 +0100 Subject: version 0.1.6 - added SRP::Session#to_hash --- lib/srp/session.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/srp/session.rb b/lib/srp/session.rb index f4b7430..38c9722 100644 --- a/lib/srp/session.rb +++ b/lib/srp/session.rb @@ -30,17 +30,21 @@ module SRP end end - def to_json(options={}) + def to_hash if @m2 - { :M2 => @m2.to_s(16) }.to_json(options) + { :M2 => @m2.to_s(16) } else { :B => bb.to_s(16), -# :b => @b.to_s(16), # only use for debugging +# :b => @b.to_s(16), # only use for debugging :salt => @user.salt.to_s(16) - }.to_json(options) + } end end + def to_json(options={}) + to_hash.to_json(options) + end + protected -- cgit v1.2.3