Class: Ecoportal::API::GraphQL::Base::Model
- Inherits:
-
Common::Content::DoubleModel
- Object
- Common::Content::DoubleModel
- Ecoportal::API::GraphQL::Base::Model
show all
- Includes:
- Common::GraphQL::ClassHelpers
- Defined in:
- lib/ecoportal/api/graphql/base/model.rb
Direct Known Subclasses
Action, ActionCategory, ContractorEntity, DateTime, Field, FileAttachment, FileContainer, LocationClassificationType, LocationNode, LocationStructure, Organization, Page, PageInfo, PersonMember, Resource, Error::LocationsError, Error::LocationsValidationError, Error::ValidationErrors, Input::Action::Archive, Input::ContractorEntity::Destroy, Input::IdDiff, Input::LocationStructure::ApplyCommands, Input::LocationStructure::CommandInterface, Input::Search, Input::SearchFilter, Input::SearchSorter, Logic::Connection, Logic::Payload, Model::Account, Model::User, Payload::LocationStructure::ApplyCommands, Payload::LocationStructure::CommandExecutionResult, Payload::LocationStructure::CommandInterface
Class Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Class Attribute Details
.client ⇒ Object
Returns the value of attribute client.
9
10
11
|
# File 'lib/ecoportal/api/graphql/base/model.rb', line 9
def client
@client
end
|
Instance Method Details
26
27
28
|
# File 'lib/ecoportal/api/graphql/base/model.rb', line 26
def as_input(clientMutationId: "")
self.class.as_input(as_update(sym_keys: true), clientMutationId: clientMutationId)
end
|
#as_update(ref = :last, ignore: [], sym_keys: false) ⇒ Object
17
18
19
20
21
22
23
24
|
# File 'lib/ecoportal/api/graphql/base/model.rb', line 17
def as_update(ref = :last, ignore: [], sym_keys: false)
new_doc = as_json
ref_doc = ref == :total ? initial_doc : original_doc
Ecoportal::API::Common::HashDiff.diff(new_doc, ref_doc, ignore: ignore).yield_self do |out|
next out unless sym_keys
Ecoportal::API::Common::GraphQL::HashHelpers.keys_to_sym_deep(out)
end
end
|