Sha256: 28ad477f6e0f764e37f96c2afe8946af1264544e3987a89bc6fe28045021fc9b

Contents?: true

Size: 944 Bytes

Versions: 3

Compression:

Stored size: 944 Bytes

Contents

module OpenFeature
  module GoFeatureFlag
    class OfrepApiResponse
      attr_reader :value, :key, :reason, :variant, :error_code, :error_details, :metadata

      def initialize(value:, key:, reason:, variant:, error_code:, error_details:, metadata:)
        @value = value
        @key = key
        @reason = reason
        @variant = variant
        @error_code = error_code
        @error_details = error_details
        @metadata = metadata
      end

      def has_error?
        !@error_code.nil? && !@error_code.empty?
      end

      def eql?(other)
        return false unless other.is_a?(OpenFeature::GoFeatureFlag::OfrepApiResponse)
        key == other.key &&
          value == other.value &&
          reason == other.reason &&
          variant == other.variant &&
          error_code == other.error_code &&
          error_details == other.error_details &&
          metadata == other.metadata
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
openfeature-go-feature-flag-provider-0.1.3 lib/openfeature/go-feature-flag/model/ofrep_api_response.rb
openfeature-go-feature-flag-provider-0.1.2 lib/openfeature/go-feature-flag/model/ofrep_api_response.rb
openfeature-go-feature-flag-provider-0.1.1 lib/openfeature/go-feature-flag/model/ofrep_api_response.rb