Sha256: c4e4580340752d413926c5ffa74b91b76fab0c31becc699a700488a753e8ef9d

Contents?: true

Size: 444 Bytes

Versions: 2

Compression:

Stored size: 444 Bytes

Contents

# frozen_string_literal: true

module Dingtalk
  module Client
    # HTTP Response result
    class Result
      attr_reader :status, :message

      # @param status  [Boolean]
      # @param message [String]  ('')
      def initialize(status, message: '')
        @status  = status != false
        @message = message.to_s
      end

      def failed?
        !success?
      end

      def success?
        status
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dingtalk-client-0.2.1 lib/dingtalk/client/result.rb
dingtalk-client-0.2.0 lib/dingtalk/client/result.rb