Class: HasHelpers::ServiceTrust::GraphQLClient::Result
- Inherits:
-
Struct
- Object
- Struct
- HasHelpers::ServiceTrust::GraphQLClient::Result
- Defined in:
- lib/has_helpers/service_trust/graphql_client.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#errors ⇒ Object
Returns the value of attribute errors.
-
#extensions ⇒ Object
Returns the value of attribute extensions.
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data
6 7 8 |
# File 'lib/has_helpers/service_trust/graphql_client.rb', line 6 def data @data end |
#errors ⇒ Object
Returns the value of attribute errors
6 7 8 |
# File 'lib/has_helpers/service_trust/graphql_client.rb', line 6 def errors @errors end |
#extensions ⇒ Object
Returns the value of attribute extensions
6 7 8 |
# File 'lib/has_helpers/service_trust/graphql_client.rb', line 6 def extensions @extensions end |
Instance Method Details
#raise_on_errors! ⇒ Object
11 12 13 14 15 |
# File 'lib/has_helpers/service_trust/graphql_client.rb', line 11 def raise_on_errors! return if success? raise GraphQLClientError, "GraphQL errors: #{errors.map { |error| error['message'] }.join('; ')}" end |
#success? ⇒ Boolean
7 8 9 |
# File 'lib/has_helpers/service_trust/graphql_client.rb', line 7 def success? errors.blank? end |