Class: BitsService::Blob

Inherits:
Object
  • Object
show all
Defined in:
lib/bits_service_client/blob.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(key:, private_endpoint:, private_http_client:, vcap_request_id:, username:, password:, resource_type:) ⇒ Blob

Returns a new instance of Blob.



6
7
8
9
10
11
12
13
14
# File 'lib/bits_service_client/blob.rb', line 6

def initialize(key:, private_endpoint:, private_http_client:, vcap_request_id:, username:, password:, resource_type:)
  @key = key
  @private_http_client = private_http_client
  @vcap_request_id = vcap_request_id
  @username = username
  @password =password
  @resource_type = resource_type
  @private_endpoint = private_endpoint
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



4
5
6
# File 'lib/bits_service_client/blob.rb', line 4

def key
  @key
end

Instance Method Details

#attributes(*_) ⇒ Object



16
17
18
# File 'lib/bits_service_client/blob.rb', line 16

def attributes(*_)
  {}
end

#guidObject



20
21
22
# File 'lib/bits_service_client/blob.rb', line 20

def guid
  key
end

#internal_download_urlObject



32
33
34
# File 'lib/bits_service_client/blob.rb', line 32

def internal_download_url
  generate_private_url(key)
end

#public_download_urlObject



24
25
26
# File 'lib/bits_service_client/blob.rb', line 24

def public_download_url
  signed_url(key)
end

#public_upload_urlObject



28
29
30
# File 'lib/bits_service_client/blob.rb', line 28

def public_upload_url
  signed_url(key, verb: 'put')+'&async=true'
end