Class: Uploadcare::SignedUrlGenerators::BaseGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/uploadcare/signed_url_generators/base_generator.rb

Direct Known Subclasses

AkamaiGenerator

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cdn_host:, secret_key:, ttl: 300, algorithm: 'sha256') ⇒ BaseGenerator

Returns a new instance of BaseGenerator.



9
10
11
12
13
14
# File 'lib/uploadcare/signed_url_generators/base_generator.rb', line 9

def initialize(cdn_host:, secret_key:, ttl: 300, algorithm: 'sha256')
  @ttl = ttl
  @algorithm = algorithm
  @cdn_host = cdn_host
  @secret_key = secret_key
end

Instance Attribute Details

#algorithmObject

Returns the value of attribute algorithm.



6
7
8
# File 'lib/uploadcare/signed_url_generators/base_generator.rb', line 6

def algorithm
  @algorithm
end

#cdn_hostObject

Returns the value of attribute cdn_host.



6
7
8
# File 'lib/uploadcare/signed_url_generators/base_generator.rb', line 6

def cdn_host
  @cdn_host
end

#secret_keyObject (readonly)

Returns the value of attribute secret_key.



7
8
9
# File 'lib/uploadcare/signed_url_generators/base_generator.rb', line 7

def secret_key
  @secret_key
end

#ttlObject

Returns the value of attribute ttl.



6
7
8
# File 'lib/uploadcare/signed_url_generators/base_generator.rb', line 6

def ttl
  @ttl
end

Instance Method Details

#generate_urlObject

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/uploadcare/signed_url_generators/base_generator.rb', line 16

def generate_url
  raise NotImplementedError, "#{__method__} method not present"
end