Class: Fog::Storage::GoogleJSON::Mock

Inherits:
Object
  • Object
show all
Includes:
Google::Shared, GetObjectHttpUrl, GetObjectHttpsUrl, Utils
Defined in:
lib/fog/storage/google_json/requests/get_object_url.rb,
lib/fog/storage/google_json/mock.rb,
lib/fog/storage/google_json/requests/get_bucket.rb,
lib/fog/storage/google_json/requests/get_object.rb,
lib/fog/storage/google_json/requests/put_bucket.rb,
lib/fog/storage/google_json/requests/put_object.rb,
lib/fog/storage/google_json/requests/copy_object.rb,
lib/fog/storage/google_json/requests/list_buckets.rb,
lib/fog/storage/google_json/requests/list_objects.rb,
lib/fog/storage/google_json/requests/delete_bucket.rb,
lib/fog/storage/google_json/requests/delete_object.rb,
lib/fog/storage/google_json/requests/get_bucket_acl.rb,
lib/fog/storage/google_json/requests/get_object_acl.rb,
lib/fog/storage/google_json/requests/put_bucket_acl.rb,
lib/fog/storage/google_json/requests/put_object_acl.rb,
lib/fog/storage/google_json/requests/put_object_url.rb,
lib/fog/storage/google_json/requests/list_bucket_acl.rb,
lib/fog/storage/google_json/requests/list_object_acl.rb,
lib/fog/storage/google_json/requests/delete_object_url.rb,
lib/fog/storage/google_json/requests/get_object_http_url.rb,
lib/fog/storage/google_json/requests/get_object_metadata.rb,
lib/fog/storage/google_json/requests/get_object_https_url.rb

Overview

:nodoc:all

Instance Attribute Summary

Attributes included from Google::Shared

#api_url, #api_version, #project

Instance Method Summary collapse

Methods included from GetObjectHttpsUrl

#get_object_https_url

Methods included from GetObjectHttpUrl

#get_object_http_url

Methods included from Google::Shared

#build_excon_response, #initialize_google_client, #request, #shared_initialize

Methods included from Utils

#http_url, #https_url, #url

Constructor Details

#initialize(options = {}) ⇒ Mock


8
9
10
# File 'lib/fog/storage/google_json/mock.rb', line 8

def initialize(options = {})
  shared_initialize(options[:google_project], GOOGLE_STORAGE_JSON_API_VERSION, GOOGLE_STORAGE_JSON_BASE_URL)
end

Instance Method Details

#copy_object(_source_bucket, _source_object, _target_bucket, _target_object, _options = {}) ⇒ Object


24
25
26
27
# File 'lib/fog/storage/google_json/requests/copy_object.rb', line 24

def copy_object(_source_bucket, _source_object,
                _target_bucket, _target_object, _options = {})
  Fog::Mock.not_implemented
end

#delete_bucket(_bucket_name) ⇒ Object


15
16
17
# File 'lib/fog/storage/google_json/requests/delete_bucket.rb', line 15

def delete_bucket(_bucket_name)
  Fog::Mock.not_implemented
end

#delete_object(_bucket_name, _object_name) ⇒ Object


16
17
18
# File 'lib/fog/storage/google_json/requests/delete_object.rb', line 16

def delete_object(_bucket_name, _object_name)
  Fog::Mock.not_implemented
end

#delete_object_url(bucket_name, object_name, expires) ⇒ Object

Raises:

  • (ArgumentError)

26
27
28
29
30
31
32
33
34
35
# File 'lib/fog/storage/google_json/requests/delete_object_url.rb', line 26

def delete_object_url(bucket_name, object_name, expires)
  raise ArgumentError.new("bucket_name is required") unless bucket_name
  raise ArgumentError.new("object_name is required") unless object_name
  https_url({
              :headers  => {},
              :host     => @host,
              :method   => "DELETE",
              :path     => "#{bucket_name}/#{object_name}"
            }, expires)
end

#get_bucket(_bucket_name, _options = {}) ⇒ Object


35
36
37
# File 'lib/fog/storage/google_json/requests/get_bucket.rb', line 35

def get_bucket(_bucket_name, _options = {})
  Fog::Mock.not_implemented
end

#get_bucket_acl(_bucket_name, _entity) ⇒ Object


24
25
26
# File 'lib/fog/storage/google_json/requests/get_bucket_acl.rb', line 24

def get_bucket_acl(_bucket_name, _entity)
  Fog::Mock.not_implemented
end

#get_object(_bucket_name, _object_name, _options = {}) ⇒ Object


75
76
77
# File 'lib/fog/storage/google_json/requests/get_object.rb', line 75

def get_object(_bucket_name, _object_name, _options = {})
  Fog::Mock.not_implemented
end

#get_object_acl(_bucket_name, _object_name) ⇒ Object


27
28
29
# File 'lib/fog/storage/google_json/requests/get_object_acl.rb', line 27

def get_object_acl(_bucket_name, _object_name)
  Fog::Mock.not_implemented
end

#get_object_metadata(_bucket_name, _object_name, _options = {}) ⇒ Object


24
25
26
# File 'lib/fog/storage/google_json/requests/get_object_metadata.rb', line 24

def (_bucket_name, _object_name, _options = {})
  Fog::Mock.not_implemented
end

#get_object_url(bucket_name, object_name, expires) ⇒ Object


14
15
16
17
# File 'lib/fog/storage/google_json/requests/get_object_url.rb', line 14

def get_object_url(bucket_name, object_name, expires)
  Fog::Logger.deprecation("Fog::Storage::Google => #get_object_url is deprecated, use #get_object_https_url instead[/] [light_black](#{caller(0..0)})")
  get_object_https_url(bucket_name, object_name, expires)
end

#list_bucket_acl(_bucket_name) ⇒ Object


18
19
20
# File 'lib/fog/storage/google_json/requests/list_bucket_acl.rb', line 18

def list_bucket_acl(_bucket_name)
  Fog::Mock.not_implemented
end

#list_bucketsObject


22
23
24
# File 'lib/fog/storage/google_json/requests/list_buckets.rb', line 22

def list_buckets
  Fog::Mock.not_implemented
end

#list_object_acl(_bucket_name, _object_name) ⇒ Object


21
22
23
# File 'lib/fog/storage/google_json/requests/list_object_acl.rb', line 21

def list_object_acl(_bucket_name, _object_name)
  Fog::Mock.not_implemented
end

#list_objects(_bucket, _options = {}) ⇒ Object


40
41
42
# File 'lib/fog/storage/google_json/requests/list_objects.rb', line 40

def list_objects(_bucket, _options = {})
  Fog::Mock.not_implemented
end

#put_bucket(_bucket_name, _options = {}) ⇒ Object


34
35
36
# File 'lib/fog/storage/google_json/requests/put_bucket.rb', line 34

def put_bucket(_bucket_name, _options = {})
  Fog::Mock.not_implemented
end

#put_bucket_acl(_bucket_name, _acl) ⇒ Object


21
22
23
# File 'lib/fog/storage/google_json/requests/put_bucket_acl.rb', line 21

def put_bucket_acl(_bucket_name, _acl)
  Fog::Mock.not_implemented
end

#put_object(_bucket_name, _object_name, _data, _options = {}) ⇒ Object


84
85
86
# File 'lib/fog/storage/google_json/requests/put_object.rb', line 84

def put_object(_bucket_name, _object_name, _data, _options = {})
  Fog::Mock.not_implemented
end

#put_object_acl(_bucket_name, _object_name, _acl) ⇒ Object


27
28
29
# File 'lib/fog/storage/google_json/requests/put_object_acl.rb', line 27

def put_object_acl(_bucket_name, _object_name, _acl)
  Fog::Mock.not_implemented
end

#put_object_url(bucket_name, object_name, expires, headers = {}) ⇒ Object

Raises:

  • (ArgumentError)

29
30
31
32
33
34
35
36
37
38
# File 'lib/fog/storage/google_json/requests/put_object_url.rb', line 29

def put_object_url(bucket_name, object_name, expires, headers = {})
  raise ArgumentError.new("bucket_name is required") unless bucket_name
  raise ArgumentError.new("object_name is required") unless object_name
  https_url({
              :headers  => headers,
              :host     => @host,
              :method   => "PUT",
              :path     => "#{bucket_name}/#{object_name}"
            }, expires)
end

#signature(_params) ⇒ Object


12
13
14
# File 'lib/fog/storage/google_json/mock.rb', line 12

def signature(_params)
  "foo"
end