Class: ImageServer::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/image_server/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cdn_hostObject

Returns the value of attribute cdn_host.



10
11
12
# File 'lib/image_server/configuration.rb', line 10

def cdn_host
  @cdn_host
end

#cdn_protocolObject

Returns the value of attribute cdn_protocol.



9
10
11
# File 'lib/image_server/configuration.rb', line 9

def cdn_protocol
  @cdn_protocol
end

#log_directoryObject

Returns the value of attribute log_directory.



6
7
8
# File 'lib/image_server/configuration.rb', line 6

def log_directory
  @log_directory
end

#loggerObject

Returns the value of attribute logger.



5
6
7
# File 'lib/image_server/configuration.rb', line 5

def logger
  @logger
end

#path_to_binaryObject

Returns the value of attribute path_to_binary.



8
9
10
# File 'lib/image_server/configuration.rb', line 8

def path_to_binary
  @path_to_binary
end

#sharded_cdn_hostObject

Returns the value of attribute sharded_cdn_host.



11
12
13
# File 'lib/image_server/configuration.rb', line 11

def sharded_cdn_host
  @sharded_cdn_host
end

#sharded_host_countObject

Returns the value of attribute sharded_host_count.



12
13
14
# File 'lib/image_server/configuration.rb', line 12

def sharded_host_count
  @sharded_host_count
end

#upload_hostObject

returns upload_host with a protocol included example: if @upload_host is ‘example.com` will return `example.com`



22
23
24
25
26
27
# File 'lib/image_server/configuration.rb', line 22

def upload_host
  return unless @upload_host
  return @upload_host if @upload_host.start_with?('http')

  "http://#{@upload_host}"
end

Instance Method Details

#portObject



14
15
16
17
18
# File 'lib/image_server/configuration.rb', line 14

def port
  return unless @upload_host

  URI(upload_host).port
end