lib/gcloud/datastore/entity.rb in gcloud-0.11.0 vs lib/gcloud/datastore/entity.rb in gcloud-0.12.0
- old
+ new
@@ -349,10 +349,16 @@
@_exclude_indexes[name] = flag
end
end
##
+ # The number of bytes the Entity will take to serialize during API calls.
+ def serialized_size
+ to_grpc.to_proto.length
+ end
+
+ ##
# @private Convert the Entity to a Google::Datastore::V1beta3::Entity
# object.
def to_grpc
grpc = Google::Datastore::V1beta3::Entity.new(
key: @key.to_grpc,
@@ -413,10 +419,10 @@
@_exclude_indexes = {}
grpc_map.each do |name, value|
next if value.nil?
@_exclude_indexes[name] = value.exclude_from_indexes
unless value.array_value.nil?
- exclude = value.array_value.values.map &:exclude_from_indexes
+ exclude = value.array_value.values.map(&:exclude_from_indexes)
@_exclude_indexes[name] = exclude
end
end
end