Class: ThumborHelpers::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/thumbor_helpers/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



35
36
37
38
39
# File 'lib/thumbor_helpers/config.rb', line 35

def initialize
  @enabled = false
  @allowed_image_extensions = /(.*\.jpe?g|.*\.png)/
  reconfigure_thumbor
end

Instance Attribute Details

#allowed_image_extensionsRegexp

RegExp match to enable thumbor images

Returns:

  • (Regexp)

    -> default (.*.jpe?g|.*.png)



33
34
35
# File 'lib/thumbor_helpers/config.rb', line 33

def allowed_image_extensions
  @allowed_image_extensions
end

#cripto_generatorObject (readonly)

Returns the value of attribute cripto_generator.



28
29
30
# File 'lib/thumbor_helpers/config.rb', line 28

def cripto_generator
  @cripto_generator
end

#enabledBoolean Also known as: enabled?

Definisce se l’override è attivo o meno

Returns:

  • (Boolean)


21
22
23
# File 'lib/thumbor_helpers/config.rb', line 21

def enabled
  @enabled
end

#image_root_hostString

Dominio dove andare a cercare l’immagine

Returns:

  • (String)


26
27
28
# File 'lib/thumbor_helpers/config.rb', line 26

def image_root_host
  @image_root_host
end

#security_keyString

Chiave per generare l’url correttamente criptato per thumbor

Returns:

  • (String)


16
17
18
# File 'lib/thumbor_helpers/config.rb', line 16

def security_key
  @security_key
end

#server_urlString

Identifica l’host di thumbor ES: thumbor.archimedianet.it

Returns:

  • (String)


11
12
13
# File 'lib/thumbor_helpers/config.rb', line 11

def server_url
  @server_url
end

Instance Method Details

#reconfigure_thumborObject



41
42
43
44
# File 'lib/thumbor_helpers/config.rb', line 41

def reconfigure_thumbor
  @cripto_generator = Thumbor::CryptoURL.new(@security_key)
  nil
end