Class: OpenFeature::GoFeatureFlag::OfrepApiResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/openfeature/go-feature-flag/model/ofrep_api_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value:, key:, reason:, variant:, error_code:, error_details:, metadata:) ⇒ OfrepApiResponse

Returns a new instance of OfrepApiResponse.



6
7
8
9
10
11
12
13
14
# File 'lib/openfeature/go-feature-flag/model/ofrep_api_response.rb', line 6

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 = 
end

Instance Attribute Details

#error_codeObject (readonly)

Returns the value of attribute error_code.



4
5
6
# File 'lib/openfeature/go-feature-flag/model/ofrep_api_response.rb', line 4

def error_code
  @error_code
end

#error_detailsObject (readonly)

Returns the value of attribute error_details.



4
5
6
# File 'lib/openfeature/go-feature-flag/model/ofrep_api_response.rb', line 4

def error_details
  @error_details
end

#keyObject (readonly)

Returns the value of attribute key.



4
5
6
# File 'lib/openfeature/go-feature-flag/model/ofrep_api_response.rb', line 4

def key
  @key
end

#metadataObject (readonly)

Returns the value of attribute metadata.



4
5
6
# File 'lib/openfeature/go-feature-flag/model/ofrep_api_response.rb', line 4

def 
  @metadata
end

#reasonObject (readonly)

Returns the value of attribute reason.



4
5
6
# File 'lib/openfeature/go-feature-flag/model/ofrep_api_response.rb', line 4

def reason
  @reason
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/openfeature/go-feature-flag/model/ofrep_api_response.rb', line 4

def value
  @value
end

#variantObject (readonly)

Returns the value of attribute variant.



4
5
6
# File 'lib/openfeature/go-feature-flag/model/ofrep_api_response.rb', line 4

def variant
  @variant
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
23
24
25
26
27
28
29
# File 'lib/openfeature/go-feature-flag/model/ofrep_api_response.rb', line 20

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 &&
     == other.
end

#has_error?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/openfeature/go-feature-flag/model/ofrep_api_response.rb', line 16

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