Sha256: 50a0ce88da3ae3e1afbe4aa68f6b175656641246d93554f2c17715ec65482a5b

Contents?: true

Size: 352 Bytes

Versions: 6

Compression:

Stored size: 352 Bytes

Contents

module Sappy
  module Responses
    class Auth < Response
      class LoginFailed < Error; end

      attr_reader :key
      def success(hash)
        @key = hash["session"].first["key"]
      end

      def failure(code, message)
        case code
        when "WRONG_DATA"
          raise LoginFailed, message
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
abcde-sappy-0.1.0 lib/sappy/responses/auth.rb
abcde-sappy-0.1.1 lib/sappy/responses/auth.rb
sappy-0.1.4 lib/sappy/responses/auth.rb
sappy-0.1.3 lib/sappy/responses/auth.rb
sappy-0.1.2 lib/sappy/responses/auth.rb
sappy-0.1.1 lib/sappy/responses/auth.rb