Class: Hako::Scripts::NginxFront::S3Config

Inherits:
Struct
  • Object
show all
Defined in:
lib/hako/scripts/nginx_front.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ S3Config

Returns a new instance of S3Config.

Parameters:

  • options (Hash)


13
14
15
16
17
# File 'lib/hako/scripts/nginx_front.rb', line 13

def initialize(options)
  self.region = options.fetch('region')
  self.bucket = options.fetch('bucket')
  self.prefix = options.fetch('prefix', nil)
end

Instance Attribute Details

#bucketObject

Returns the value of attribute bucket

Returns:

  • (Object)

    the current value of bucket



11
12
13
# File 'lib/hako/scripts/nginx_front.rb', line 11

def bucket
  @bucket
end

#prefixObject

Returns the value of attribute prefix

Returns:

  • (Object)

    the current value of prefix



11
12
13
# File 'lib/hako/scripts/nginx_front.rb', line 11

def prefix
  @prefix
end

#regionObject

Returns the value of attribute region

Returns:

  • (Object)

    the current value of region



11
12
13
# File 'lib/hako/scripts/nginx_front.rb', line 11

def region
  @region
end

Instance Method Details

#key(app_id) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/hako/scripts/nginx_front.rb', line 19

def key(app_id)
  if prefix
    "#{prefix}/#{app_id}.conf"
  else
    "#{app_id}.conf"
  end
end