Class: Hako::Front::S3Config

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ S3Config

Returns a new instance of S3Config.



7
8
9
10
11
# File 'lib/hako/front.rb', line 7

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



6
7
8
# File 'lib/hako/front.rb', line 6

def bucket
  @bucket
end

#prefixObject

Returns the value of attribute prefix

Returns:

  • (Object)

    the current value of prefix



6
7
8
# File 'lib/hako/front.rb', line 6

def prefix
  @prefix
end

#regionObject

Returns the value of attribute region

Returns:

  • (Object)

    the current value of region



6
7
8
# File 'lib/hako/front.rb', line 6

def region
  @region
end

Instance Method Details

#key(app_id) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/hako/front.rb', line 13

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