NAME
Google::Ads::GoogleAds::Utils::FieldMasks
DESCRIPTION
Utility for constructing field masks, which are necessary for update operations.
METHODS
field_mask
Compares two hash objects and computes a Google::Ads::GoogleAds::Common::FieldMask object based on the differences between them. The field mask is necessary for update operations, and the field paths in the field mask are in lower underscore format.
Parameters
original: the original hash object.
modified: the modified hash object.
Returns
A Google::Ads::GoogleAds::Common::FieldMask object reflecting the changes between the original and modified objects.
all_set_fields_of
Constructs a Google::Ads::GoogleAds::Common::FieldMask object that captures the list of all set fields of an object. The field paths in the field mask are in lower underscore format.
Parameters
modified: the modified hash object.
Returns
A Google::Ads::GoogleAds::Common::FieldMask object that captures the list of all set fields of an object.
get_field_value
Looks up the value of the field located at the given path on an object.
Parameters
object: the object to search on.
path: the path of the field.
Returns
The value of the field located at the give path on the object.
__compare
The private method to compare a given field for two objects, and capture the differences between them recursively.
Parameters
paths: the paths array to store the differences.
current_field: the field name to compare.
original: the original hash object.
modified: the modified hash object.
__is_hash_ref
The private method to check if a reference object is for a hash or a class instance.
Parameters
ref: the reference object to check.
Returns
True, if the reference object is for a hash or a class instance. False, otherwise.
LICENSE AND COPYRIGHT
Copyright 2019 Google LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
REPOSITORY INFORMATION
$Rev: $
$LastChangedBy: $
$Id: $