Skip to content

Commit

Permalink
Merge pull request #800 from blowmage/more-doc-changes
Browse files Browse the repository at this point in the history
Additional documentation changes
  • Loading branch information
quartzmo authored Jul 22, 2016
2 parents 80bbe5c + f7ff388 commit 50c3413
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 8 deletions.
4 changes: 3 additions & 1 deletion lib/gcloud/bigquery/dataset/access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,20 @@ def changed?
@original_rules_hashes != @rules.map(&:to_h)
end

# @private
def empty?
@rules.empty?
end

# @private
def freeze
@rules = @rules.map(&:dup).map(&:freeze)
@rules.freeze
super
end

##
# View the access rules as an array of hashes.
# @private View the access rules as an array of hashes.
def to_a
@rules.map(&:to_h)
end
Expand Down
10 changes: 5 additions & 5 deletions lib/gcloud/bigquery/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,9 @@ def location
end

##
# Returns the table's schema as hash containing the keys and values
# returned by the Google Cloud BigQuery [Rest API
# ](https://cloud.google.com/bigquery/docs/reference/v2/tables#resource).
# This method can also be used to set, replace, or add to the schema by
# passing a block. See {Schema} for available methods.
# Returns the table's schema. This method can also be used to set,
# replace, or add to the schema by passing a block. See {Schema} for
# available methods.
#
# @param [Boolean] replace Whether to replace the existing schema with the
# new schema. If `true`, the fields will replace the existing schema. If
Expand All @@ -329,6 +327,8 @@ def location
# @yield [schema] a block for setting the schema
# @yieldparam [Table::Schema] schema the object accepting the schema
#
# @return [Gcloud::Bigquery::Schema]
#
# @example
# require "gcloud"
#
Expand Down
2 changes: 1 addition & 1 deletion lib/gcloud/storage/bucket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ def cors
end

##
# Make sure any cors changes are saved
# @private Make sure any cors changes are saved
def check_for_mutable_cors!
return if @cors_builder.nil?
return unless @cors_builder.changed?
Expand Down
3 changes: 3 additions & 0 deletions lib/gcloud/storage/bucket/cors.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,18 @@ def add_rule origin, methods, headers: nil, max_age: nil
push Rule.new(origin, methods, headers: headers, max_age: max_age)
end

# @private
def to_gapi
map(&:to_gapi)
end

# @private
def self.from_gapi gapi_list
rules = Array(gapi_list).map { |gapi| Rule.from_gapi gapi }
new rules
end

# @private
def freeze
each(&:freeze)
super
Expand Down
2 changes: 1 addition & 1 deletion lib/gcloud/storage/file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ def metadata= metadata
end

##
# Make sure any metadata changes are saved
# @private Make sure any metadata changes are saved
def check_for_changed_metadata!
return if @metadata == @gapi.metadata
@gapi.metadata = @metadata
Expand Down

0 comments on commit 50c3413

Please sign in to comment.