Class: Google::Cloud::Bigquery::Dataset::Updater
- Inherits:
-
Google::Cloud::Bigquery::Dataset
- Object
- Google::Cloud::Bigquery::Dataset
- Google::Cloud::Bigquery::Dataset::Updater
- Defined in:
- lib/google/cloud/bigquery/dataset.rb
Overview
Yielded to a block to accumulate changes for a patch request.
Data collapse
-
#updates ⇒ Object
readonly
A list of attributes that were updated.
Data collapse
- #access ⇒ Object
-
#check_for_mutated_access! ⇒ Object
Make sure any access changes are saved.
-
#initialize(gapi) ⇒ Updater
constructor
Create an Updater object.
- #to_gapi ⇒ Object
Methods inherited from Google::Cloud::Bigquery::Dataset
#api_url, #create_table, #create_view, #created_at, #dataset_id, #default_expiration, #default_expiration=, #delete, #description, #description=, #etag, #load, #location, #modified_at, #name, #name=, #project_id, #query, #query_job, #table, #tables
Constructor Details
#initialize(gapi) ⇒ Updater
Create an Updater object.
1113 1114 1115 1116 |
# File 'lib/google/cloud/bigquery/dataset.rb', line 1113 def initialize gapi @updates = [] @gapi = gapi end |
Instance Attribute Details
#updates ⇒ Object (readonly)
A list of attributes that were updated.
1109 1110 1111 |
# File 'lib/google/cloud/bigquery/dataset.rb', line 1109 def updates @updates end |
Instance Method Details
#access ⇒ Object
1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 |
# File 'lib/google/cloud/bigquery/dataset.rb', line 1118 def access # TODO: make sure to call ensure_full_data! on Dataset#update @access ||= Access.from_gapi @gapi if block_given? yield @access check_for_mutated_access! end # Same as Dataset#access, but not frozen @access end |
#check_for_mutated_access! ⇒ Object
Make sure any access changes are saved
1131 1132 1133 1134 1135 1136 |
# File 'lib/google/cloud/bigquery/dataset.rb', line 1131 def check_for_mutated_access! return if @access.nil? return unless @access.changed? @gapi.update! access: @access.to_gapi patch_gapi! :access end |
#to_gapi ⇒ Object
1138 1139 1140 1141 |
# File 'lib/google/cloud/bigquery/dataset.rb', line 1138 def to_gapi check_for_mutated_access! @gapi end |