Class: FileStore::Config

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

Constant Summary collapse

VALID_CONFIGS =
[:aws_access_key, :aws_access_secret, :aws_s3_bucket,
:aws_region].freeze

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



6
7
8
# File 'lib/file_store/config.rb', line 6

def initialize
  @_config_hash = {}
end

Instance Method Details

#configObject

Set up accessors for the config fields



12
13
14
15
# File 'lib/file_store/config.rb', line 12

VALID_CONFIGS.each { |config|
  define_method(config) { @_config_hash[config] }
  define_method("#{config}=") { |value| @_config_hash[config] = value }
}

#to_hObject



17
18
19
# File 'lib/file_store/config.rb', line 17

def to_h
  @_config_hash
end