Sha256: d16e2bdd1a89eeecfc827105661bb4b9ab512002f885c0d615a3996480deed54

Contents?: true

Size: 1.27 KB

Versions: 25

Compression:

Stored size: 1.27 KB

Contents

# :nodoc:
#
# Copyright (C) 2014 Authlete, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


module Authlete
  module Response
    # == Authlete::Response::Base
    #
    # The base class of responses from Authlete Web APIs.
    #
    class BaseResponse
      include Authlete::Utility

      # The code assigned to the result of the API call.
      attr_accessor :result_code

      # The message about the result of the API call.
      attr_accessor :result_message

      # The constructor which takes a hash that represents a JSON response
      # from an Authlete API.
      def initialize(hash = {})
        @result_code    = extract_value(hash, :resultCode)
        @result_message = extract_value(hash, :resultMessage)
      end
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
authlete-0.2.5 lib/authlete/response/base-response.rb
authlete-0.2.4 lib/authlete/response/base-response.rb
authlete-0.2.3 lib/authlete/response/base-response.rb
authlete-0.2.2 lib/authlete/response/base-response.rb
authlete-0.2.1 lib/authlete/response/base-response.rb
authlete-0.2.0 lib/authlete/response/base-response.rb
authlete-0.1.9 lib/authlete/response/base-response.rb
authlete-0.1.8 lib/authlete/response/base-response.rb
authlete-0.1.7 lib/authlete/response/base-response.rb
authlete-0.1.6 lib/authlete/response/base-response.rb
authlete-0.1.5 lib/authlete/response/base-response.rb
authlete-0.1.4 lib/authlete/response/base-response.rb
authlete-0.1.3 lib/authlete/response/base-response.rb
authlete-0.1.2 lib/authlete/response/base-response.rb
authlete-0.1.1 lib/authlete/response/base-response.rb
authlete-0.1.0 lib/authlete/response/base-response.rb
authlete-0.0.9 lib/authlete/response/base-response.rb
authlete-0.0.8 lib/authlete/response/base-response.rb
authlete-0.0.7 lib/authlete/response/base-response.rb
authlete-0.0.6 lib/authlete/response/base-response.rb