Class: OpenFeature::OFREP::Response
- Inherits:
-
Object
- Object
- OpenFeature::OFREP::Response
- Defined in:
- lib/openfeature/ofrep/provider/response.rb
Instance Attribute Summary collapse
-
#error_code ⇒ Object
readonly
Returns the value of attribute error_code.
-
#error_details ⇒ Object
readonly
Returns the value of attribute error_details.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#variant ⇒ Object
readonly
Returns the value of attribute variant.
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #error? ⇒ Boolean
-
#initialize(value:, key:, reason:, variant:, error_code:, error_details:, metadata:) ⇒ Response
constructor
A new instance of Response.
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_code ⇒ Object (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_details ⇒ Object (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 |
#key ⇒ Object (readonly)
Returns the value of attribute key.
6 7 8 |
# File 'lib/openfeature/ofrep/provider/response.rb', line 6 def key @key end |
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
6 7 8 |
# File 'lib/openfeature/ofrep/provider/response.rb', line 6 def @metadata end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
6 7 8 |
# File 'lib/openfeature/ofrep/provider/response.rb', line 6 def reason @reason end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/openfeature/ofrep/provider/response.rb', line 6 def value @value end |
#variant ⇒ Object (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
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
18 19 20 |
# File 'lib/openfeature/ofrep/provider/response.rb', line 18 def error? !@error_code.nil? && !@error_code.empty? end |