class Fog::Storage::GoogleJSON::Files
Public Instance Methods
all(options = {})
click to toggle source
# File lib/fog/storage/google_json/models/files.rb, line 17 def all(options = {}) requires :directory data = service.list_objects(directory.key, attributes.merge(options)) .to_h[:items] || [] load(data) end
each() { |f| ... }
click to toggle source
# File lib/fog/storage/google_json/models/files.rb, line 25 def each if block_given? subset = dup.all subset.each_file_this_page { |f| yield f } end self end
Also aliased as: each_file_this_page
get(key, options = {}, &block)
click to toggle source
# File lib/fog/storage/google_json/models/files.rb, line 34 def get(key, options = {}, &block) requires :directory data = service.get_object(directory.key, key, options, &block).to_h new(data) rescue ::Google::Apis::ClientError => e raise e unless e.status_code == 404 nil end
get_https_url(key, expires, options = {})
click to toggle source
# File lib/fog/storage/google_json/models/files.rb, line 43 def get_https_url(key, expires, options = {}) requires :directory service.get_object_https_url(directory.key, key, expires, options) end
metadata(key, options = {})
click to toggle source
# File lib/fog/storage/google_json/models/files.rb, line 48 def metadata(key, options = {}) requires :directory data = service.get_object_metadata(directory.key, key, options).to_h new(data) rescue ::Google::Apis::ClientError nil end
Also aliased as: head
new(opts = {})
click to toggle source
Calls superclass method
# File lib/fog/storage/google_json/models/files.rb, line 57 def new(opts = {}) requires :directory super({ :directory => directory }.merge(opts)) end