Class: OpenFeature::OFREP::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/openfeature/ofrep/provider/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

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

Returns a new instance of Response.



8
9
10
11
12
13
14
15
16
# File 'lib/openfeature/ofrep/provider/response.rb', line 8

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.



6
7
8
# File 'lib/openfeature/ofrep/provider/response.rb', line 6

def error_code
  @error_code
end

#error_detailsObject (readonly)

Returns the value of attribute error_details.



6
7
8
# File 'lib/openfeature/ofrep/provider/response.rb', line 6

def error_details
  @error_details
end

#keyObject (readonly)

Returns the value of attribute key.



6
7
8
# File 'lib/openfeature/ofrep/provider/response.rb', line 6

def key
  @key
end

#metadataObject (readonly)

Returns the value of attribute metadata.



6
7
8
# File 'lib/openfeature/ofrep/provider/response.rb', line 6

def 
  @metadata
end

#reasonObject (readonly)

Returns the value of attribute reason.



6
7
8
# File 'lib/openfeature/ofrep/provider/response.rb', line 6

def reason
  @reason
end

#valueObject (readonly)

Returns the value of attribute value.



6
7
8
# File 'lib/openfeature/ofrep/provider/response.rb', line 6

def value
  @value
end

#variantObject (readonly)

Returns the value of attribute variant.



6
7
8
# File 'lib/openfeature/ofrep/provider/response.rb', line 6

def variant
  @variant
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
28
29
30
31
# File 'lib/openfeature/ofrep/provider/response.rb', line 22

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

#error?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/openfeature/ofrep/provider/response.rb', line 18

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