Class: Eco::API::UseCases::GraphQL::Helpers::Location::Command::InputUnitResponse
- Inherits:
-
Object
- Object
- Eco::API::UseCases::GraphQL::Helpers::Location::Command::InputUnitResponse
- Defined in:
- lib/eco/api/usecases/graphql/helpers/location/command/input_unit_response.rb
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #commands ⇒ Object
-
#conflictingIds ⇒ Object
rubocop:disable Naming/MethodName.
-
#conflictingIds? ⇒ Boolean
rubocop:disable Naming/MethodName.
- #draft ⇒ Object
- #error? ⇒ Boolean (also: #errors?)
-
#error_doc ⇒ Object
brief summary of the error.
-
#initialize(input, response) ⇒ InputUnitResponse
constructor
A new instance of InputUnitResponse.
- #ok? ⇒ Boolean
- #structure ⇒ Object
Constructor Details
#initialize(input, response) ⇒ InputUnitResponse
Returns a new instance of InputUnitResponse.
5 6 7 8 |
# File 'lib/eco/api/usecases/graphql/helpers/location/command/input_unit_response.rb', line 5 def initialize(input, response) @input = input @response = response end |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
3 4 5 |
# File 'lib/eco/api/usecases/graphql/helpers/location/command/input_unit_response.rb', line 3 def input @input end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/eco/api/usecases/graphql/helpers/location/command/input_unit_response.rb', line 3 def response @response end |
Instance Method Details
#commands ⇒ Object
18 19 20 |
# File 'lib/eco/api/usecases/graphql/helpers/location/command/input_unit_response.rb', line 18 def commands input[:commands] end |
#conflictingIds ⇒ Object
rubocop:disable Naming/MethodName
47 48 49 |
# File 'lib/eco/api/usecases/graphql/helpers/location/command/input_unit_response.rb', line 47 def conflictingIds # rubocop:disable Naming/MethodName draft_conflicting_ids & target_ids end |
#conflictingIds? ⇒ Boolean
rubocop:disable Naming/MethodName
43 44 45 |
# File 'lib/eco/api/usecases/graphql/helpers/location/command/input_unit_response.rb', line 43 def conflictingIds? # rubocop:disable Naming/MethodName conflictingIds.any? end |
#draft ⇒ Object
10 11 12 |
# File 'lib/eco/api/usecases/graphql/helpers/location/command/input_unit_response.rb', line 10 def draft response&.draft end |
#error? ⇒ Boolean Also known as: errors?
31 32 33 34 35 36 |
# File 'lib/eco/api/usecases/graphql/helpers/location/command/input_unit_response.rb', line 31 def error? return false if response.nil? return true if conflictingIds? response.error? # draft might have previous, but we will stop anyway! end |
#error_doc ⇒ Object
brief summary of the error
23 24 25 26 27 28 29 |
# File 'lib/eco/api/usecases/graphql/helpers/location/command/input_unit_response.rb', line 23 def error_doc if (err_doc = response&.error_doc) return err_doc end conflictingIds if conflictingIds? end |
#ok? ⇒ Boolean
39 40 41 |
# File 'lib/eco/api/usecases/graphql/helpers/location/command/input_unit_response.rb', line 39 def ok? !errors? end |
#structure ⇒ Object
14 15 16 |
# File 'lib/eco/api/usecases/graphql/helpers/location/command/input_unit_response.rb', line 14 def structure draft&.structure end |