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

Defined Under Namespace

Classes: MockClient

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

#apply_client_options, #build_excon_response, #initialize_google_client, #request, #shared_initialize

Methods included from Utils

#http_url, #https_url, #url

Constructor Details

#initialize(options = {}) ⇒ Mock

Returns a new instance of Mock.



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

def initialize(options = {})
  shared_initialize(options[:google_project], GOOGLE_STORAGE_JSON_API_VERSION, GOOGLE_STORAGE_JSON_BASE_URL)
  @client = MockClient.new('test')
  @storage_json = MockClient.new('test')
  @iam_service = MockClient.new('test')
end

Instance Method Details

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



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

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

#delete_bucket(_bucket_name) ⇒ Object



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

def delete_bucket(_bucket_name)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#delete_object(_bucket_name, _object_name) ⇒ Object



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

def delete_object(_bucket_name, _object_name)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
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
38
39
# File 'lib/fog/storage/google_json/requests/get_bucket.rb', line 35

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

#get_bucket_acl(_bucket_name, _entity) ⇒ Object



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

def get_bucket_acl(_bucket_name, _entity)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

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



77
78
79
80
81
# File 'lib/fog/storage/google_json/requests/get_object.rb', line 77

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

#get_object_acl(_bucket_name, _object_name) ⇒ Object



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

def get_object_acl(_bucket_name, _object_name)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

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



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

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

#get_object_url(bucket_name, object_name, expires, options = {}) ⇒ 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, options = {})
  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, options)
end

#google_access_idObject



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

def google_access_id
  "[email protected]"
end

#list_bucket_acl(_bucket_name) ⇒ Object



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

def list_bucket_acl(_bucket_name)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#list_bucketsObject



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

def list_buckets
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

#list_object_acl(_bucket_name, _object_name) ⇒ Object



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

def list_object_acl(_bucket_name, _object_name)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

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



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

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

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



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

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

#put_bucket_acl(_bucket_name, _acl) ⇒ Object



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

def put_bucket_acl(_bucket_name, _acl)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
end

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



94
95
96
97
98
# File 'lib/fog/storage/google_json/requests/put_object.rb', line 94

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

#put_object_acl(_bucket_name, _object_name, _acl) ⇒ Object



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

def put_object_acl(_bucket_name, _object_name, _acl)
  # :no-coverage:
  Fog::Mock.not_implemented
  # :no-coverage:
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



17
18
19
# File 'lib/fog/storage/google_json/mock.rb', line 17

def signature(_params)
  "foo"
end