Class: Rack::Thumb::Proxy::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rack-thumb-proxy/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



10
11
12
# File 'lib/rack-thumb-proxy/configuration.rb', line 10

def initialize
  initialize_defaults!
end

Instance Attribute Details

#cache_control_headersObject (readonly)

Returns the value of attribute cache_control_headers.



7
8
9
# File 'lib/rack-thumb-proxy/configuration.rb', line 7

def cache_control_headers
  @cache_control_headers
end

#option_labelsObject (readonly)

Returns the value of attribute option_labels.



8
9
10
# File 'lib/rack-thumb-proxy/configuration.rb', line 8

def option_labels
  @option_labels
end

Instance Method Details

#hash_signatures_in_use?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/rack-thumb-proxy/configuration.rb', line 33

def hash_signatures_in_use?
  !!@secret
end

#key_length(new_key_length = nil) ⇒ Object



19
20
21
22
# File 'lib/rack-thumb-proxy/configuration.rb', line 19

def key_length(new_key_length = nil)
  @key_length = new_key_length if new_key_length
  return @key_length
end

#mount_point(new_mount_point = nil) ⇒ Object



14
15
16
17
# File 'lib/rack-thumb-proxy/configuration.rb', line 14

def mount_point(new_mount_point = nil)
  @mount_point = new_mount_point if new_mount_point
  return @mount_point
end

#option_label(label, options) ⇒ Object



29
30
31
# File 'lib/rack-thumb-proxy/configuration.rb', line 29

def option_label(label, options)
  option_labels.merge!(label.to_sym => options)
end

#secret(new_secret = nil) ⇒ Object



24
25
26
27
# File 'lib/rack-thumb-proxy/configuration.rb', line 24

def secret(new_secret = nil)
  @secret = new_secret if new_secret
  return @secret
end